<type>documentation</type>
<domain>intro</domain>
<id>command-line-usage</id>
<title>Command Line Usage</title>
<date>$Date$</date>
<version>$Revision$</version>
<product>per+</product>

You can run Wing from the command line as follows:

**On Windows**, the executable is called ``~~EXECUTABLE~~.exe`` and is located
in the ``bin`` directory in your Wing installation.  This is not on the ``PATH``
by default, but may be added with the Windows Control Panel.
~~~if WEBSITE:
In Wing Personal the executable is instead named ``wing-personal.exe`` and
in Wing 101 it is named ``wing-101.exe``.
~~~

**On Linux**, the executable is called ``~~FULL_EXECUTABLE~~`` and is
already on the ``PATH`` as long as Wing was installed from Debian or
RPM package.  Otherwise, the executable is ``~~EXECUTABLE~~`` in the
installation directory.
~~~if WEBSITE:
In Wing Personal the executable is instead named ``wing-personal~~MAJOR_VERSION~~.~~MINOR_VERSION~~`` and
in Wing 101 it is named ``wing-101-~~MAJOR_VERSION~~.~~MINOR_VERSION~~``.
~~~

**On OS X**, the executable is called ``~~EXECUTABLE~~`` and is located in
``Contents/Resources`` within the ``.app`` bundle directory.  This is
not on the ``PATH`` by default, but could be added either by
adding that directory to ``PATH`` in ``~/.profile`` (for example, 
``PATH="/Applications/~~OSX_BUNDLE~~.app/Contents/Resources:${PATH}"; export PATH``)
or by placing a symbolic link (for example, by typing ``sudo ln -s 
/Applications/~~OSX_BUNDLE~~.app/Contents/Resources/~~EXECUTABLE~~ 
~~FULL_EXECUTABLE~~`` in a directory that is already on the ``PATH``).
~~~if WEBSITE:
In Wing Personal the  executable is instead named ``wing-personal`` and
in Wing 101 it is named ``wing-101``.
~~~

Opening Files and Projects
--------------------------

Once you have established a way to start Wing from the command line, you
may specify a list of files to open after the executable name. These can 
be arbitrary text files and a project file. For example, the following 
will open project file ``myproject.wpr`` and also the three source files 
``mysource.py``, ``README``, and ``Makefile``::

  ~~EXECUTABLE~~.exe mysource.py README Makefile myproject.wpr  

Wing determines file type by extension, so position of the project file name
(if any) on the command line is not important.  

A line number may be specified for the first file on the command line by appending
``:<line-number>`` to the file name.  For example, ``README:100`` will position the 
cursor at the start of line 100 of the README file.

Command Line Options
--------------------

The following options may be specified anywhere on the command line:

**--prefs-file** -- Add the file name following this argument
to the list of preferences files that are opened by the IDE.  These
files are opened after the system-wide and default user preferences
files, so values in them override those given in other preferences files.

**--new** -- By default Wing will reuse an existing running instance
of Wing to open files specified on the command line.  This option turns
off this behavior and forces creation of a new instance of Wing.  Note
that a new instance is always created if no files are given on the command
line.

**--reuse** -- Force Wing to reuse an existing running instance of Wing
IDE even if there are no file names given on the command line.  This
just brings Wing to the front.

**--settings=fullpath** -- Use the given fullpath instead of the default 
location for the `Settings Directory <ref:install/user-settings-dir>`__.

**--cache=fullpath** -- Use the given fullpath instead of the default 
location for the cache directory.

**--verbose** -- *(Posix only)*  This option causes Wing to print
verbose error reporting output to ``stderr``.  On Windows, run 
``console_wing.exe`` instead for the same result.

**--disable-updates** -- Load Wing without applying any updates made since 
the last installation from an installer package.  If you are having problems
with an update, the update can be reverted from the `About box <script:about_application>`__.

**--check-install** -- Check the installation and all updates to make sure
that files have not changed or been removed since they were installed.  Combine
this with ``--disable-updates`` to check only the original installation that
was made from an installer package.

**--use-winghome** -- *(For developers only)*  This option
sets WINGHOME to be used during this run.  It is used internally and by
developers contributing to Wing.  The directory to use follows
this argument.

**--use-src** -- *(For developers only)*  This option is
used to force Wing to run from Python source files even if compiled
files are present in the ``bin`` directory, as is the case after a
distribution has been built.

**--orig-python-path** -- *(For developers only)*  This option is
used internally to indicate the original Python path in use by the user
before Wing was launched.  The path follows this argument.

**--squelch-output** -- *(For developers only)*  This option prevents
any output of any kind to ``stdout`` and ``stderr``.  Used on Windows to avoid
console creation.

