creator-cli.qdoc 8.5 KB
Newer Older
1 2
/****************************************************************************
**
3 4
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
5
**
6
** This file is part of the Qt Creator documentation.
7
**
8 9 10 11 12 13 14
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
15
**
16
** GNU Free Documentation License Usage
17 18
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
19 20 21 22
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
23 24 25 26 27 28 29 30 31 32
**
****************************************************************************/

// **********************************************************************
// NOTE: the sections are not ordered by their logical order to avoid
// reshuffling the file each time the index order changes (i.e., often).
// Run the fixnavi.pl script to adjust the links to the index order.
// **********************************************************************

/*!
33
    \contentspage {Qt Creator Manual}
34
    \previouspage creator-project-generic.html
35 36 37 38 39
    \page creator-cli.html
    \nextpage creator-keyboard-shortcuts.html

    \title Using Command Line Options

Tobias Hunger's avatar
Tobias Hunger committed
40
    You can start \QC and specify some options from the command line. For
41
    example, you can open a file to any line and column.
42 43 44 45

    To specify command line options, enter the following command in the \QC
    installation or build directory:

46
    \c {qtcreator [option] [filename[:line_number[:column_number]]]}
47 48

    \note You can use either a colon (:) or a plus sign (+) as a separator
49 50
    between the filename and line number and the line number and the column
    number. You can also use a space between the separator and the line number.
51

Leena Miettinen's avatar
Leena Miettinen committed
52
    For example, on Windows:
53 54 55

    \list

56
        \li \c {C:\qtcreator\bin>qtcreator -help}
57

58
        \li \c {C:\qtcreator\bin>qtcreator C:\TextFinder\textfinder.cpp:100:2}
59

60
        \li \c {C:\qtcreator\bin>qtcreator C:\TextFinder\textfinder.cpp +100+2}
61 62 63

    \endlist

Leena Miettinen's avatar
Leena Miettinen committed
64 65 66 67 68 69 70 71
    On OS X:

    \list

        \li \c {Qt Creator.app/Contents/MacOS/Qt Creator -help}

    \endlist

Tobias Hunger's avatar
Tobias Hunger committed
72 73 74 75
    To open a project that is located in a particular folder, you can pass on
    the folder name as a command line argument. \QC looks for a session that
    matches the folder name and loads it. Or it looks for a project file in the
    folder and opens it. For example:
76 77 78

    \c {qtcreator .}

79 80 81 82 83 84 85 86 87
    \note To run a self-built \QC from the command line on Windows, make sure
    that the Qt installation directory is included in the PATH environment
    variable. You can enter the following command on the command line to add Qt
    to the path:

    \code
    set PATH=<Qt_installation_directory>\mingw\bin;c:<Qt_installation_directory>\bin;%PATH%
    \endcode

88 89 90 91
    The following table summarizes the available options:

    \table
        \header
Tobias Hunger's avatar
Tobias Hunger committed
92 93
            \li Option
            \li Description
94 95

        \row
Tobias Hunger's avatar
Tobias Hunger committed
96 97
            \li -help
            \li Display help on command line options.
98 99

        \row
Tobias Hunger's avatar
Tobias Hunger committed
100 101
            \li -version
            \li Display \QC version.
102 103

        \row
Tobias Hunger's avatar
Tobias Hunger committed
104 105
            \li -client
            \li Attempt to connect to an already running instance of \QC.
106

Leena Miettinen's avatar
Leena Miettinen committed
107 108 109 110 111 112 113 114 115 116
       \row
            \li -pid
            \li Attempt to connect to an already running instance of \QC with
                the specified process ID.

        \row
            \li -block
            \li Open files in editors in a running \QC instance and block the
                command line until the first editor is closed.

Daniel Teske's avatar
Daniel Teske committed
117 118
       \row
            \li -load <plugin>
119 120 121 122 123 124 125 126
            \li Enable the specified plugin and all plugins that it depends on.
                You can combine \c -load and \c -noload options and specify both
                options multiple times to enable and disable several plugins.
                The actions are executed in the specified order.

       \row
            \li -load all
            \li Enables all plugins.
Daniel Teske's avatar
Daniel Teske committed
127

128
        \row
Tobias Hunger's avatar
Tobias Hunger committed
129 130
            \li -noload <plugin>
            \li Disable the specified plugin and all plugins that depend on it.
131 132

        \row
Tobias Hunger's avatar
Tobias Hunger committed
133 134
            \li -noload all
            \li Disables all plugins.
135 136

        \row
Tobias Hunger's avatar
Tobias Hunger committed
137 138
            \li -profile
            \li Output plugin start up and shut down profiling data.
139

Leena Miettinen's avatar
Leena Miettinen committed
140 141 142 143 144
       \row
            \li -pluginpath <path>
            \li Add a path where \QC looks for plugins. To specify several
                paths, add the \c{-pluginpath} option for each path.

145
        \row
Tobias Hunger's avatar
Tobias Hunger committed
146 147
            \li -settingspath <path>
            \li Override the default path where user settings are stored.
148 149

        \row
Tobias Hunger's avatar
Tobias Hunger committed
150 151
            \li -color <color>
            \li Core plugin: override the selected UI color.
152

Leena Miettinen's avatar
Leena Miettinen committed
153 154
       \row
            \li -presentationMode
Tobias Hunger's avatar
Tobias Hunger committed
155 156
            \li Core plugin: display keyboard shortcuts as popups when you
                press them. Mostly useful when presenting \QC to someone else.
Leena Miettinen's avatar
Leena Miettinen committed
157

158
        \row
Tobias Hunger's avatar
Tobias Hunger committed
159 160 161
            \li -theme <default | dark>
            \li Core plugin: apply a dark color theme to \QC, without using
                stylesheets.
162

163
        \row
Tobias Hunger's avatar
Tobias Hunger committed
164 165 166
            \li -debug <pid>
            \li Debugger plugin: attach to the process with the given process
                ID.
167 168

        \row
Tobias Hunger's avatar
Tobias Hunger committed
169 170 171 172 173
            \li -debug <executable>[,kit=<kit>]
            \li Debugger plugin: launch and debug the executable with the name
                \c{executable}.
                A \c{kit} can be specified to point to non-default debuggers
                and sysroots.
174 175

        \row
Tobias Hunger's avatar
Tobias Hunger committed
176 177 178 179 180 181 182 183 184 185
            \li -debug [executable,]core=<corefile>[,kit=<kit>]
            \li Debugger plugin: load the core file named \c{corefile}.
                The parameter \c{executable} specifies the executable that
                produced the core file.
                If this parameter is omitted, \QC will attempt to reconstruct
                it from the core file itself. This will fail for paths with more
                than about 80 characters.
                In such cases the \c{executable} parameter is mandatory.
                A \c{kit} can be specified to point to non-default debuggers
                and sysroots.
186 187

        \row
Tobias Hunger's avatar
Tobias Hunger committed
188 189 190 191 192 193 194
            \li -debug <executable>,server=<server:port>[,kit=<kit>]
            \li Debugger plugin: attach to a debug server running on the port
                \c{port} on the server \c{server}. The parameter \c{executable}
                specifies a local copy of the executable the remote debug server
                is manipulating.
                A \c{kit} can be specified to point to non-default debuggers and
                sysroots.
195 196

        \row
Tobias Hunger's avatar
Tobias Hunger committed
197 198 199
            \li -wincrashevent <event-handle:pid>
            \li Debugger plugin: Attach to crashed processes by using the
                specified event handle and process ID.
200 201

        \row
Tobias Hunger's avatar
Tobias Hunger committed
202 203 204 205
            \li -customwizard-verbose
            \li ProjectExplorer plugin: display additional information when
                loading custom wizards. For more information about custom
                wizards, see \l{Adding New Custom Wizards}
206 207

        \row
Tobias Hunger's avatar
Tobias Hunger committed
208 209 210 211 212
            \li -lastsession
            \li ProjectExplorer plugin: load the last session when \QC starts.
                Open the projects and files that were open when you last exited
                \QC. For more information about managing sessions, see
                \l{Managing Sessions}.
213 214 215

    \endtable

216 217
    \section1 Using Custom Styles

Tobias Hunger's avatar
Tobias Hunger committed
218 219 220 221 222
    \QC is a \l{QApplication}{Qt application}, and therefore, it accepts the
    command line options that all Qt applications accept. For example, you can
    use the \c {-style} and \c {-stylesheet} options to apply custom styles and
    \l{Qt Style Sheets}{stylesheets}. The styling is only applied during the
    current session.
223 224 225 226 227 228

    Exercise caution when applying styles, as overriding the existing styling
    may make some items difficult to see. Also, setting a stylesheet may affect
    the \l{Specifying Text Editor Settings}{text editor color scheme} and the
    styling of the integrated \QD.

229 230 231
    You can also switch to a dark theme to customize the appearance of widgets,
    colors, and icons without using stylesheets.

Tobias Hunger's avatar
Tobias Hunger committed
232
*/