Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: drev on December 10, 2007, 08:56:45 pm

Title: Pass command line argument after build and exec
Post by: drev 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
Title: Re: Pass command line argument after build and exec
Post by: thomas on December 10, 2007, 09:04:12 pm
Project --> Set Program's Arguments
Title: Re: Pass command line argument after build and exec
Post by: drev on March 10, 2008, 01:48:47 pm
Thanks !
Title: Re: Pass command line argument after build and exec
Post by: Seronis 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).