JAL-629 Updated help docs and fixed structure image subvalues
[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   </ul>
36
37   <h2><a name="introduction"></a>Introduction</h2>
38
39   <p>
40   From version 2.11.3.0 Jalview has a new set of command line arguments
41   which allow more powerful and flexible combinations of arguments, though can
42   also be used for simple use cases too.
43   </p>
44
45   <p>
46   These new arguments are all accessed with a <code>--doubledash</code> form of
47   command line argument (with the one exception where simply opening one or more
48   files can be performed without any arguments other than the filenames).
49   </p>
50
51   <p>
52   The old command line arguments can still be used (see
53   <a href="clarguments-old.html">the old page on command line arguments</a>) so
54   existing scripts utilising them should not break.
55   <br/>
56   <strong>These are now deprecated and will be removed</strong> in a future version of Jalview.
57   </p>
58
59   <p>
60   However, you cannot mix old and new style arguments, so if you use any
61   <code>-singledash</code> arguments (with the exception of <code>-help</code> or <code>-h</code>), they will all be interpreted as
62   old style arguments with the new <code>--doubledash</code>
63   arguments being ignored.  If you have a script
64   that uses the old arguments without any dashes, and uses the bare-word
65   <code>open</code> then these will also be interpreted as old style arguments.
66   </p>
67
68   <p>
69   <strong>Warning!</strong> If you use command line arguments without any dashes and
70   <em>don't</em> use the bare-word argument <code>open</code> then all
71   your arguments will be interpreted as alignment files to be opened by the
72   new command line argument process!
73   </p>
74
75   <p>
76   To launch Jalview from the command line, see
77   <a href="commandline.html">running Jalview from the command line</a>.
78   </p>
79
80
81   <h2><a name="syntax"></a>Syntax</h2>
82
83   <p>
84   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.
85   </p>
86
87   <h3>
88   Parts of Jalview's command line arguments
89   </h3>
90   <pre>jalview --argname[linkedId]=[subvalues]value --switch --noswitch --argname[linkedId] [subvalues]filename1 filename2 ...</pre>
91
92   <p>
93   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).
94   <br/>
95   <ul>
96     <li>
97         For arguments that require a value, the value can be given after an equals-sign ('=') or a space (' ').
98         <br/>
99         <code>--arg value</code>
100         <br/>
101         <code>--arg=value</code>
102     </li>
103     <li>
104         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.
105         <br/>
106         <code>--arg file1.fa otherfile.stk</code>
107         <br/>
108         <code>--arg filename*.fa</code> <em>(expanded by shell)</em>
109         <br/>
110         <code>--arg=filename*.fa</code> <em>(expanded by Jalview)</em>
111     </li>
112     <li>
113         For arguments that act as a switch, most can be negated by preceding the argument name with <code>no</code>.
114         <br/>
115         <code>--switch</code>
116         <br/>
117         <code>--noswitch</code>
118     </li>
119     <li>
120         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.
121         <ul>
122           <li>
123               An argument immediately following the main argument.
124               <br/>
125               <code>--image output.png --scale 2.5</code>
126           </li>
127           <li>
128               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.
129               <br/>
130               <code>--open=[nowrap,colour=gecos-blossom]uniref50.fa</code>
131               <br/>
132               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.
133           </li>
134           <li>
135               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.
136               <br/>
137               <code>--image[MYID]=output.png --other --args --scale[MYID]=2.5</code>
138           </li>
139           <li>
140               An argument that is designated as applying to <em>all linked IDs</em>
141               <br/>
142               <code>--image=output.png --other --args --all --scale=2.5</code>
143               <br/>
144               <code>--image=output.png --other --args --scale[*]=2.5</code>
145           </li>
146         </ul>
147     </li>
148   </ul>
149   </p>
150
151   <p>
152   This may sound complicated, but nearly everything can be done just with plain command line arguments, though in this case the ordering of the arguments is more important.
153   </p>
154
155   <hr/>
156   Continue to <a href="clarguments-basic.html">Command Line: basic usage</a>.
157   <br/>
158   <a href="clarguments-reference.html">Command Line: reference</a>
159
160 </body>
161 </html>