JAL-3830 JAL-4160 Remove --noheadless as --gui does this. Simplifies wrapper scripts
[jalview.git] / help / help / html / features / clarguments.html
1 <html>
2 <!--
3  * Jalview is distributed in the hope that it will be useful, but 
4  * WITHOUT ANY WARRANTY; without even the implied warranty 
5  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
6  * PURPOSE.  See the GNU General Public License for more details.
7  * 
8  * You should have received a copy of the GNU General Public License
9  * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
10  * The Jalview Authors are detailed in the 'AUTHORS' file.
11  -->
12 <title>Command Line: introduction and reference</title>
13 <body>
14
15   <h1>Command Line: introduction and reference</h1>
16
17   <p>
18   Command Line: introduction
19   <br/>
20   <a href="clarguments-basic.html">Command Line: basic usage</a>
21   <br/>
22   <a href="clarguments-advanced.html">Command Line: advanced usage</a>
23   <br/>
24   <a href="clarguments-argfiles.html">Command Line: argument files</a>
25   <br/>
26   <a href="clarguments-reference.html">Command Line: reference</a>
27   </p>
28
29
30   <hr/>
31
32   <ul>
33   <li><a href="#introduction">Introduction</a></li>
34   <li><a href="#syntax">Syntax</a></li>
35   <li><a href="#headlessmode">Headless mode</a></li>
36   </ul>
37
38   <h2><a name="introduction"></a>Introduction</h2>
39
40   <p>
41   From version 2.11.3.0 Jalview has a new set of command line arguments
42   which allow more powerful and flexible combinations of arguments, though can
43   also be used for simple use cases too.
44   </p>
45
46   <p>
47   These new arguments are all accessed with a <code>--doubledash</code> form of
48   command line argument (with the one exception where simply opening one or more
49   files can be performed without any arguments other than the filenames).
50   </p>
51
52   <p>
53   The old command line arguments can still be used (see
54   <a href="clarguments-old.html">the old page on command line arguments</a>) so
55   existing scripts utilising them should not break.
56   <br/>
57   <strong>These are now deprecated and will be removed</strong> in a future version of Jalview.
58   </p>
59
60   <p>
61   However, you cannot mix old and new style arguments, so if you use any
62   <code>-singledash</code> arguments (with the exception of <code>-help</code> or <code>-h</code>), they will all be interpreted as
63   old style arguments with the new <code>--doubledash</code>
64   arguments being ignored.  If you have a script
65   that uses the old arguments without any dashes, and uses the bare-word
66   <code>open</code> then these will also be interpreted as old style arguments.
67   </p>
68
69   <p>
70   <strong>Warning!</strong> If you use command line arguments without any dashes and
71   <em>don't</em> use the bare-word argument <code>open</code> then all
72   your arguments will be interpreted as alignment files to be opened by the
73   new command line argument process!
74   </p>
75
76   <p>
77   To launch Jalview from the command line, see
78   <a href="commandline.html">running Jalview from the command line</a>.
79   </p>
80
81
82   <h2><a name="syntax"></a>Syntax</h2>
83
84   <p>
85   The new command line argument parser can group certain labelled arguments together, or give them a default label based on their position in the list of arguments (in which case you won't ever need to know what the label is).  All arguments are read before any alignment actions are performed.  For basic usage without additional syntax, please see the <a href="clarguments-basic.html">Command Line: basic usage</a> explanatory page.
86   </p>
87
88   <h3>
89   Parts of Jalview's command line arguments
90   </h3>
91   <pre>jalview --argname[linkedId]=[subvalues]value --switch --noswitch --argname[linkedId] [subvalues]filename1 filename2 ...</pre>
92
93   <p>
94   Different arguments can take one or more values, others take no value and act like a switch (some can be set on and off and others are only on, depending on the use).
95   <br/>
96   <ul>
97     <li>
98         For arguments that require a value, the value can be given after an equals-sign ('=') or a space (' ').
99         <br/>
100         <code>--arg value</code>
101         <br/>
102         <code>--arg=value</code>
103     </li>
104     <li>
105         For arguments that can take multiple values (these will be filenames), the multiple filenames should appear after a space. If you use a filename wildcard you can put this after a space (which will be expanded by the shell unto multiple filenames before they reach Jalview), or you can put it after an equals-sign, which will be used by Jalview to find a list of files.  You cannot use an equals-sign and value followed by further values.
106         <br/>
107         <code>--arg file1.fa otherfile.stk</code>
108         <br/>
109         <code>--arg filename*.fa</code> <em>(filenames expanded by shell)</em>
110         <br/>
111         <code>--arg=filename*.fa</code> <em>(filenames expanded by Jalview)</em>
112     </li>
113     <li>
114         For arguments that act as a switch, most can be negated by preceding the argument name with <code>no</code>.
115         <br/>
116         <code>--switch</code>
117         <br/>
118         <code>--noswitch</code>
119     </li>
120     <li>
121         Some values can be modified, or may need additional information (for instance an <code>--image</code> output can be modified with a <code>--scale=number</code> factor, or a <code>--structure</code> can refer to a sequence with a <code>--seqid=ID</code>).  This additional information can be added in a number of different ways.
122         <ul>
123           <li>
124               An argument immediately following the main argument.
125               <br/>
126               <code>--image output.png --scale 2.5</code>
127           </li>
128           <li>
129               A <em>sub-value modifier</em>, which is where one or more (comma-separated) values are added to the start of the main value, placed in square brackets.
130               <br/>
131               <code>--open=[nowrap,colour=gecos-blossom]uniref50.fa</code>
132               <br/>
133               Sub-value modifiers with a value must use an equals-sign separator, and those that act as a switch can simply be included without an equals-sign or value, and can be preceded with <code>no</code> to negate the value, as with the argument name.
134           </li>
135           <li>
136               Another argument with the same <em>linked ID</em>.  A linked ID is an optional identifier for a particular open alignment, placed in square brackets immediately following the argument name (before the equals-sign or space).  If linked IDs are specified they do not need to be near to each other.
137               <br/>
138               <code>--image[MYID]=output.png --other --args --scale[MYID]=2.5</code>
139           </li>
140           <li>
141               An argument that is designated as applying to <em>all linked IDs</em>
142               <br/>
143               <code>--image=output.png --other --args --all --scale=2.5</code>
144               <br/>
145               <code>--image=output.png --other --args --scale[*]=2.5</code>
146           </li>
147         </ul>
148     </li>
149   </ul>
150   </p>
151
152   <p>
153   This may sound complicated, but nearly everything can be done just with plain command line arguments (see <a href="clarguments-basic.html">Command Line: basic usage</a>), though in this case the ordering of the arguments is more important.
154   </p>
155
156
157   <h2><a name="headlessmode"></a>Headless mode</h2>
158
159   <p>
160   Jalview can be run in headless mode, i.e. without the usual graphical user interface (GUI), by specifying the <code>--headless</code> argument.  With command line arguments you can specify operations for Jalview to perform on one or more files and then stop running.  Most likely you will want to output another file, either an alignment for image file.
161   </p>
162   <p>
163   <strong>If you specify an argument for an output file</strong> (one or more of <code>--output</code>, <code>--image</code> or <code>--structureimage</code>) then it will be assumed that you wish to <strong>run in headless mode</strong>.
164   </p>
165   <p>
166   You can force Jalview to run in graphical mode using the <code>--gui</code> argument.
167   </p>
168
169   <p>
170   </p>
171
172
173   <hr/>
174   Continue to <a href="clarguments-basic.html">Command Line: basic usage</a>.
175   <br/>
176   <a href="clarguments-reference.html">Command Line: reference</a>
177
178 </body>
179 </html>