Difference between revisions of "Code::Blocks command line arguments"

From Code::Blocks
 
 
(13 intermediate revisions by 7 users not shown)
Line 1: Line 1:
 +
[[Category: User Documentation]]
 
== Using command line arguments ==
 
== Using command line arguments ==
  
Line 17: Line 18:
 
# Launch a terminal client, such as XTerm, Gnome Terminal or Konsole.
 
# Launch a terminal client, such as XTerm, Gnome Terminal or Konsole.
 
# Type "codeblocks" and then append the command line arguments you want to use.
 
# 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'''
 
'''Example'''
Line 22: Line 25:
 
  codeblocks --no-splash-screen --debug-log
 
  codeblocks --no-splash-screen --debug-log
  
== List of command line arguments ==
+
== Command line arguments ==
 
 
'''/h''', '''--help'''
 
 
 
:Shows a help message about the command line arguments.
 
 
 
'''/na''', '''--no-check-associations'''
 
 
 
:Don't perform any file association checks (Windows only).
 
  
'''/nd''', '''--no-dde'''
+
{| border="1" cellpadding="3" cellspacing="0" style="border: 1px solid gray; border-collapse: collapse;"
 +
|+
 +
|- style="background: #ececec; border: 1px solid gray"
 +
!
 +
! 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.
 +
|-
  
:Don't start a DDE server (Windows only).
+
|-
 +
|
 +
|'''--file='''''<filename>[:line]''
 +
| Open file in Code::Blocks and optionally jump to a specific line.
 +
|-
  
:''[http://en.wikipedia.org/wiki/Dynamic_Data_Exchange More info about DDE]''
+
|-
 +
|'''/h''', '''/?'''
 +
|'''--help''', '''--?'''
 +
| Shows a help message about the command line arguments.
 +
|-
  
'''/ns''', '''--no-splash-screen'''
+
|-
 +
|'''/na'''
 +
|'''--no-check-associations'''
 +
| Don't perform any file association checks (Windows only).
 +
|-
  
:Hides the splash screen when the application is loading.
+
|-
 +
|'''/nd'''
 +
|'''--no-dde'''
 +
| Don't start a [http://en.wikipedia.org/wiki/Dynamic_Data_Exchange DDE] server (Windows only).
 +
|-
  
'''/d''', '''--debug-log'''
+
|-
 +
|'''/ns'''
 +
|'''--no-splash-screen'''
 +
| Hides the splash screen when the application is loading.
 +
|-
  
:Display application's debug log.
+
|-
 +
|'''/d'''
 +
|'''--debug-log'''
 +
| Display application's debug log.
 +
|-
  
'''--prefix='''''<str>''
+
|-
 +
|
 +
|'''--prefix='''''<str>''
 +
| Sets the shared data directory prefix.
 +
|-
  
:Sets the shared data directory prefix.
+
|-
 +
|'''/p'''
 +
|'''--personality='''''<str>'', '''--profile='''''<str>''
 +
| Sets the [[Personalities|personality]] to use. You can use ''ask'' as the parameter to list available personalities.
 +
|-
  
'''/p''', '''--personality='''''<str>'', '''--profile='''''<str>''
+
|-
 +
|
 +
|'''--rebuild'''
 +
| Clean and build the project / workspace.
 +
|-
  
:Sets the personality to use. You can use ''ask'' as the parameter to list available personalities.
+
|-
 +
|
 +
|'''--build'''
 +
| Build the project / workspace.
 +
|-
  
:''Main article: [[Personalities]]''
+
|-
 +
|
 +
|'''--target='''''<str>''
 +
| Sets target for batch build. For example --target="Release".
 +
|-
  
'''--rebuild'''
+
|-
 +
|
 +
|'''--no-batch-window-close'''
 +
| Keeps the batch log window visible after the batch build has completed.
 +
|-
  
:Clean and build the project / workspace.
+
|-
 +
|
 +
|'''--batch-build-notify'''
 +
| Shows a message after the batch build has completed.
 +
|-
  
'''--build'''
+
|-
 +
|
 +
|'''--user-data-dir=<path>'''
 +
| specify an alternative directory for user settings and user installed plugins
 +
|-
  
:Build the project / workspace.
+
|-
 +
|
 +
|'''--script=<str>'''
 +
| specify a script file to run after loading
 +
|-
  
'''--target='''''<str>''
+
|-
 +
|
 +
|'''--target=<str>'''
 +
| the target for the batch build
 +
|-
 +
             
 +
|-
 +
|
 +
|'''--clean'''
 +
| clean the project/workspace
 +
|-
  
:Sets target for batch build.
+
|-
 +
|
 +
|'''--rebuild'''
 +
| clean and then build the project/workspace
 +
|-
  
'''--no-batch-window-close'''
+
|-
 +
|
 +
|'''--build'''
 +
| just build the project/workspace
 +
|-
  
:Keeps the batch log window visible after the batch build has completed.
+
|-
 +
|
 +
|'''--verbose'''
 +
| Enable logging of c::b errors
 +
|-
 +
|
 +
|'''-S''' setName
 +
|Set <nowiki>''</nowiki>setName<nowiki>''</nowiki> to current active set for global variables (after [r13245])
 +
|-
 +
|
 +
|'''-D''' <set>.uservar.mem=val
 +
|Set the member ''mem'' of uservariable ''uservar'' in set to value ''val''. This overrides the current set value (after [r13245])
 +
|-
  
'''--batch-build-notify'''
+
|-
 +
|
 +
|'''>''' ''<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
 +
|-
  
:Shows a message after the batch build has completed.
+
|}

Latest revision as of 21:32, 13 November 2023

Using command line arguments

Windows

  1. Find the Code::Blocks shortcut in the Desktop or Start menu.
  2. Right click on the icon and select Properties.
  3. Select the Shortcut tab.
  4. Append the command line arguments you want to use to the end of the Target text (behind the quote mark).
  5. Run Code::Blocks by using the shortcut you edited.

Example

"C:\Program Files\CodeBlocks\codeblocks.exe" /na /nd

*nix

  1. Launch a terminal client, such as XTerm, Gnome Terminal or Konsole.
  2. 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.
--file=<filename>[:line] Open file in Code::Blocks and optionally jump to a specific line.
/h, /? --help, --? Shows a help message about the command line arguments.
/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.
/d --debug-log Display application's debug log.
--prefix=<str> Sets the shared data directory prefix.
/p --personality=<str>, --profile=<str> Sets the personality to use. You can use ask as the parameter to list available personalities.
--rebuild Clean and build the project / workspace.
--build Build 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.
--user-data-dir=<path> specify an alternative directory for user settings and user installed plugins
--script=<str> specify a script file to run after loading
--target=<str> the target for the batch build
--clean clean the project/workspace
--rebuild clean and then build the project/workspace
--build just build the project/workspace
--verbose Enable logging of c::b errors
-S setName Set ''setName'' to current active set for global variables (after [r13245])
-D <set>.uservar.mem=val Set the member mem of uservariable uservar in set to value val. This overrides the current set value (after [r13245])
> <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