Difference between revisions of "Code::Blocks command line arguments"
From Code::Blocks
(→Command line arguments: Add missing arguments and remove duplicated ones) |
|||
| Line 44: | Line 44: | ||
| Specifies the project *.cbp filename or workspace *.workspace filename. For instance ''<filename>'' may be ''c:\some\where\a\project.cbp''. Place this argument at end of command line, just before output redirection if any. | | Specifies the project *.cbp filename or workspace *.workspace filename. For instance ''<filename>'' may be ''c:\some\where\a\project.cbp''. Place this argument at end of command line, just before output redirection if any. | ||
|- | |- | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
|- | |- | ||
| Line 55: | Line 50: | ||
|'''--help''', '''--?''' | |'''--help''', '''--?''' | ||
| Shows a help message about the command line arguments. | | Shows a help message about the command line arguments. | ||
| + | |- | ||
| + | | | ||
| + | |'''--safe-mode''' | ||
| + | |Load in safe mode (all plugins will be disabled). | ||
|- | |- | ||
| Line 73: | Line 72: | ||
|'''--no-splash-screen''' | |'''--no-splash-screen''' | ||
| Hides the splash screen when the application is loading. | | Hides the splash screen when the application is loading. | ||
| + | |- | ||
| + | | | ||
| + | |'''--multiple-instance''' | ||
| + | |Allow running multiple instances. | ||
|- | |- | ||
| Line 79: | Line 82: | ||
|'''--debug-log''' | |'''--debug-log''' | ||
| Display application's debug log. | | Display application's debug log. | ||
| + | |- | ||
| + | |'''/nc''' | ||
| + | |'''--no-crash-handler''' | ||
| + | |Do not use the crash handler (useful for debugging C::B). | ||
|- | |- | ||
| + | |- | ||
| + | |'''/v''' | ||
| + | |'''--verbose''' | ||
| + | | Show more debugging messages. | ||
|- | |- | ||
| | | | ||
| − | |'''--prefix='''''<str>'' | + | |'''--prefix''='''''<nowiki/>''<str>'' |
| Sets the shared data directory prefix. | | Sets the shared data directory prefix. | ||
|- | |- | ||
|- | |- | ||
| − | |'''/p''' | + | | |
| − | |'''--personality='''''<str>'', '''--profile='''''<str>'' | + | |'''--user-data-dir'''=<str> |
| + | | Specify an alternative directory for user settings and user installed plugins | ||
| + | |- | ||
| + | |'''/p''' str | ||
| + | |'''--personality='''''<str>'', '''--profile''='''''<nowiki/>''<str>'' | ||
| Sets the [[Personalities|personality]] to use. You can use ''ask'' as the parameter to list available personalities. | | Sets the [[Personalities|personality]] to use. You can use ''ask'' as the parameter to list available personalities. | ||
|- | |- | ||
| − | + | | | |
| + | |'''--no-log''' | ||
| + | |Turn off the application log. | ||
| + | |- | ||
| + | | | ||
| + | |'''--log-to-file''' | ||
| + | |Redirect application log to a file. | ||
| + | |- | ||
| + | | | ||
| + | |'''--debug-log-to-file''' | ||
| + | |Redirect application debug log to a file. | ||
| + | |- | ||
| + | |- | ||
| + | |'''/S''' name | ||
| + | |'''--set'''=name | ||
| + | |Set <nowiki>''</nowiki>name<nowiki>''</nowiki> to current active set for global variables (after [r13245]). | ||
| + | |- | ||
| + | |'''/D''' str | ||
| + | | | ||
| + | |If ''str'' = "<set>.uservar.mem=val", set the member ''mem'' of uservariable ''uservar'' in ''set'' to value ''val''. This overrides the current set value (after [r13245]). | ||
|- | |- | ||
| | | | ||
| Line 104: | Line 138: | ||
| Build the project / workspace. | | Build the project / workspace. | ||
|- | |- | ||
| − | |||
|- | |- | ||
| | | | ||
| − | |'''--target='''''<str>'' | + | |'''--clean''' |
| − | | Sets target for batch build | + | | Clean the project/workspace |
| + | |- | ||
| + | | | ||
| + | |'''--target''='''''<nowiki/>''<str>'' | ||
| + | | Sets target for batch build, for example --target="Release". | ||
|- | |- | ||
| Line 122: | Line 159: | ||
| Shows a message after the batch build has completed. | | Shows a message after the batch build has completed. | ||
|- | |- | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
|- | |- | ||
|- | |- | ||
| | | | ||
| − | |'''--script=<str> | + | |'''--script'''=<str> |
| specify a script file to run after loading | | specify a script file to run after loading | ||
|- | |- | ||
| Line 137: | Line 169: | ||
|- | |- | ||
| | | | ||
| − | |'''-- | + | |'''--file='''<filename>[:line] |
| − | | | + | | Open file in Code::Blocks and optionally jump to a specific line. |
|- | |- | ||
| − | |||
|- | |- | ||
| − | |||
| − | |||
| − | |||
|- | |- | ||
|- | |- | ||
| | | | ||
| − | |'''-- | + | |'''--dbg-config'''=<str> |
| − | | | + | | Selects the debugger config used for attaching. |
|- | |- | ||
| − | |||
|- | |- | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
|- | |- | ||
| | | | ||
| − | |'''-- | + | |'''--dbg-attach'''=<str> |
| − | + | |''str'' is passed to debugger plugin which is used for attaching to a process. | |
| − | |||
| − | |||
| − | |||
| − | | | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
|- | |- | ||
| | | | ||
Latest revision as of 13:18, 5 November 2024
Using command line arguments
Windows
- Find the Code::Blocks shortcut in the Desktop or Start menu.
- Right click on the icon and select Properties.
- Select the Shortcut tab.
- Append the command line arguments you want to use to the end of the Target text (behind the quote mark).
- Run Code::Blocks by using the shortcut you edited.
Example
"C:\Program Files\CodeBlocks\codeblocks.exe" /na /nd
*nix
- Launch a terminal client, such as XTerm, Gnome Terminal or Konsole.
- Type "codeblocks" and then append the command line arguments you want to use.
Note: Code::Blocks can not run on a real console, X11 must be running and you must use a graphical terminal emulator.
Example
codeblocks --no-splash-screen --debug-log
Command line arguments
| Argument | Function | |
|---|---|---|
| Windows | Windows(MSYS2, WSL)
Linux, Unix, MacOS |
|
| <filename> | Specifies the project *.cbp filename or workspace *.workspace filename. For instance <filename> may be c:\some\where\a\project.cbp. Place this argument at end of command line, just before output redirection if any. | |
| /h, /? | --help, --? | Shows a help message about the command line arguments. |
| --safe-mode | Load in safe mode (all plugins will be disabled). | |
| /na | --no-check-associations | Don't perform any file association checks (Windows only). |
| /nd | --no-dde | Don't start a DDE server (Windows only). |
| /ns | --no-splash-screen | Hides the splash screen when the application is loading. |
| --multiple-instance | Allow running multiple instances. | |
| /d | --debug-log | Display application's debug log. |
| /nc | --no-crash-handler | Do not use the crash handler (useful for debugging C::B). |
| /v | --verbose | Show more debugging messages. |
| --prefix=<str> | Sets the shared data directory prefix. | |
| --user-data-dir=<str> | Specify an alternative directory for user settings and user installed plugins | |
| /p str | --personality=<str>, --profile=<str> | Sets the personality to use. You can use ask as the parameter to list available personalities. |
| --no-log | Turn off the application log. | |
| --log-to-file | Redirect application log to a file. | |
| --debug-log-to-file | Redirect application debug log to a file. | |
| /S name | --set=name | Set ''name'' to current active set for global variables (after [r13245]). |
| /D str | If str = "<set>.uservar.mem=val", set the member mem of uservariable uservar in set to value val. This overrides the current set value (after [r13245]). | |
| --rebuild | Clean and build the project / workspace. | |
| --build | Build the project / workspace. | |
| --clean | Clean the project/workspace | |
| --target=<str> | Sets target for batch build, for example --target="Release". | |
| --no-batch-window-close | Keeps the batch log window visible after the batch build has completed. | |
| --batch-build-notify | Shows a message after the batch build has completed. | |
| --script=<str> | specify a script file to run after loading | |
| --file=<filename>[:line] | Open file in Code::Blocks and optionally jump to a specific line. | |
| --dbg-config=<str> | Selects the debugger config used for attaching. | |
| --dbg-attach=<str> | str is passed to debugger plugin which is used for attaching to a process. | |
| > <build log file> | Placed in the very last position of command line, this may be used to redirect standard output to log file, this is not a codeblock option as such, but just a DOS/*nix shell usual standard output redirection |