Author Topic: Pass command line argument after build and exec  (Read 4257 times)

Offline drev

  • Multiple posting newcomer
  • *
  • Posts: 21
Pass command line argument after build and exec
« on: December 10, 2007, 08:56:45 pm »
Hello,
Is it possible to specify some argument to pass at a console project
directly in code::block (currently, I must do it via Dos or xterm...)

thanks

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Pass command line argument after build and exec
« Reply #1 on: December 10, 2007, 09:04:12 pm »
Project --> Set Program's Arguments
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline drev

  • Multiple posting newcomer
  • *
  • Posts: 21
Re: Pass command line argument after build and exec
« Reply #2 on: March 10, 2008, 01:48:47 pm »
Thanks !

Offline Seronis

  • Almost regular
  • **
  • Posts: 197
Re: Pass command line argument after build and exec
« Reply #3 on: March 10, 2008, 02:42:17 pm »
I do a lot of console app projects myself and recent had a feature request that ended up being doable with the tools menu.  Basically I requested that there be a toolbar button that would launch a console window whose working directory was already set to the current Targets build directory.  The way i was instructed to do this was:

"Tools" menu -> "Configure Tools..."

'User Defined Tools' dialog appears

click "Add" button

'Edit Tools' dialog appears.  Choose a name for your custom tool you like (I chose 'Launch Console'), executable was cmd.exe and the variable you need to use in the 'Working Directory' field of the edit tools dialog is:

${TARGET_OUTPUT_DIR}

After that I assigned the menu to my F10 key (it wasnt already assigned) and it does all i need.  Plus doing this, you dont have to traverse to the project settings to repeatedly change the default command line arguments when you need to test different options.  It just dumps you to the directory you need (based on your build target).