News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

How do I set the arguments to run a target with?

Started by Jonathan Blow, June 30, 2008, 06:59:25 PM

Previous topic - Next topic

Jonathan Blow

This is probably a stupid question but I can't figure out how to set command-line arguments when running a target from CodeBlocks.  This is one of the most basic things anyone would ever want to do, so there's got to be a way to do it, but I can't find it anywhere in the IDE, and I have searched the documentation and found nothing.

I found the place where the working directory gets set (in Properties/Build Targets/[target]/Execution working dir), which might be one place I would expect the arguments to be settable; it's not there.

Can anyone clue me in?

MortenMacFly

Quote from: Jonathan Blow on June 30, 2008, 06:59:25 PM
how to set command-line arguments when running a target from CodeBlocks.
Go to the menu "project" and then "Set program's arguments".
...probably we should rename this entry into something like "Set target's/program's arguments".
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

dje


Jonathan Blow

Cool; thanks.  One of the first things I will try to write for Code::Blocks is a plugin that creates a toolbar that just has the arguments in it, so you can change them easily without navigating menus.  This was one of the things that annoyed me all to hell about Visual Studio (especially given how long it would take to pop up the settings menu)... CB's menus are a lot faster but it's still a lot more indirect than I would like!

MortenMacFly

Quote from: dje on June 30, 2008, 09:11:33 PM
What about Run/Debug arguments ?
...same thing?! I guess I don't get the question...?!
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

dje

Quote from: MortenMacFly on July 01, 2008, 08:43:09 AM
Quote from: dje on June 30, 2008, 09:11:33 PM
What about Run/Debug arguments ?
...same thing?! I guess I don't get the question...?!
The first time I use Code::Blocks, I was looking for something like Run/Debug arguments". I tried "Set program's arguments" once but I find it less clear than "Run/Debug arguments".

Dje

MortenMacFly

Quote from: dje on July 01, 2008, 09:10:30 AM
but I find it less clear than "Run/Debug arguments".
You come from the VS world, right?! ;-)
This does not apply to C::B as targets do not necessarily be just "Release" and "Debug". Look at the C::B project file for example. There you don't have any release/debug target but just libraries, the SDK and the main application (and some preprocessor tools probably). So setting parameters for release/debug doesn't make sense for C::B.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

dje

Quote from: MortenMacFly on July 01, 2008, 02:39:20 PM
Quote from: dje on July 01, 2008, 09:10:30 AM
but I find it less clear than "Run/Debug arguments".
You come from the VS world, right?! ;-)
Yes, all is not wonderful but as there is only one framework and one compiler/linker/debugger completely imbricated/integrated/"englued", it seems that configuration is a little easier.

Nevertheless, forgetting Visual aspects, does it make sense to have this item in the project menu ?
Isn't host application useful only when working on static or shared libraries ? What should be related only to project/target ?
I think a better place for this could be in the project properties where we have the output/targets. I think we should find in the project menu the files related operations and the links to the project properties and build options, not this detailed part of configuration.

Dje

dmoore

dje: I think it's where it is because it is easier to access for people who regularly change their program args. I also had to ask before I found that option, but I'm not sure it's the name (although I see nothing wrong with "Run/Debug arguments" and I don't use VStudio) of the menu option as much as being in an unexpected place. The first thing I would do would be to move the menu item down between build options and properties in the project menu. An option to access that dialog could also be added as a button in project -> properties -> build targets.
Python plugins: [url="https://github.com/spillz/codeblocks-python"]https://github.com/spillz/codeblocks-python[/url]
Code::Blocks Daily Builds -- Ubuntu PPA: [url="https://launchpad.net/~damien-moore/+archive/codeblocks"]https://launchpad.net/~damien-moore/+archive/codeblocks[/url]