123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- <html lang="en">
- <head>
- <title>Command Line Syntax - avram - a virtual machine code interpreter</title>
- <meta http-equiv="Content-Type" content="text/html">
- <meta name="description" content="avram - a virtual machine code interpreter">
- <meta name="generator" content="makeinfo 4.13">
- <link title="Top" rel="start" href="index.html#Top">
- <link rel="up" href="User-Manual.html#User-Manual" title="User Manual">
- <link rel="prev" href="Parameter-Mode-Options.html#Parameter-Mode-Options" title="Parameter Mode Options">
- <link rel="next" href="Diagnostics.html#Diagnostics" title="Diagnostics">
- <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
- <meta http-equiv="Content-Style-Type" content="text/css">
- <style type="text/css"><!--
- pre.display { font-family:inherit }
- pre.format { font-family:inherit }
- pre.smalldisplay { font-family:inherit; font-size:smaller }
- pre.smallformat { font-family:inherit; font-size:smaller }
- pre.smallexample { font-size:smaller }
- pre.smalllisp { font-size:smaller }
- span.sc { font-variant:small-caps }
- span.roman { font-family:serif; font-weight:normal; }
- span.sansserif { font-family:sans-serif; font-weight:normal; }
- --></style>
- </head>
- <body>
- <div class="node">
- <a name="Command-Line-Syntax"></a>
- <p>
- Next: <a rel="next" accesskey="n" href="Diagnostics.html#Diagnostics">Diagnostics</a>,
- Previous: <a rel="previous" accesskey="p" href="Parameter-Mode-Options.html#Parameter-Mode-Options">Parameter Mode Options</a>,
- Up: <a rel="up" accesskey="u" href="User-Manual.html#User-Manual">User Manual</a>
- <hr>
- </div>
- <h3 class="section">1.5 Command Line Syntax</h3>
- <p><a name="index-command-line-46"></a>The command line parameters that follow the virtual code file name
- when <code>avram</code> is used in parameter mode (<a href="Parameter-Mode.html#Parameter-Mode">Parameter Mode</a>) are dependent on the
- specific application. However, all supported applications are
- constrained for implementation reasons to observe certain uniform
- conventions regarding their command line parameters, which are
- documented here to avoid needless duplication.
- <p><a name="index-shell-47"></a><a name="index-file-parameters-48"></a><a name="index-input-files-49"></a>The shell divides the command line into "arguments" separated by white
- space. Arguments containing white space or special characters used by
- the shell must be quoted or protected as usual. File names with wild
- cards in them are expanded by the shell before <code>avram</code> sees them.
- <p><code>avram</code> then extracts from the sequence of arguments a sequence of
- filenames and a sequence of options. Each option consists of a keyword and an
- optional parameter list. Filenames, keywords, and parameter lists are
- distinguished according to the following criteria.
- <ol type=1 start=1>
- <li>An argument is treated as a keyword iff it meets these three
- conditions.
- <ol type=a start=1>
- <li>It starts with a dash.
- <li>It doesn't contain an equals sign.
- <li>It doesn't consist solely of a dash.
- </ol>
- <li>An argument is treated as a parameter list iff it meets these four
- conditions.
- <ol type=a start=1>
- <li>It doesn't begin with a dash.
- <li>It either begins with an equals sign or doesn't contain one.
- <li>It immediately follows an argument beginning with a dash, not
- containing an equals sign and not consisting solely of a dash.
- <li>At least one of the following is true.
- <ol type=1 start=1>
- <li>It doesn't contain a period, tilde, or path separator.
- <a name="index-path-separators-50"></a><li>It contains a comma.
- <li>It can be interpreted as a C formatted floating point number.
- </ol>
- </ol>
- <li>An argument is treated as an input file name iff it meets these four
- conditions.
- <ol type=a start=1>
- <li>It doesn't begin with a dash.
- <li>It doesn't contain an equals sign.
- <li>It doesn't contain a comma.
- <li>At least one of the following is true.
- <ol type=1 start=1>
- <li>It contains a period, tilde, or path separator.
- <li>It doesn't immediately follow an argument beginning with a dash, not
- consisting solely of a dash, and not containing an equals sign.
- </ol>
- </ol>
- <li>If an argument contains an equals sign but doesn't begin with one,
- the part on the left of the first equals sign is treated as a
- keyword and the part on the right is treated as a parameter list.
- <li>An argument consisting solely of a dash is taken to represent the
- standard input file.
- <li>An argument not fitting any of the above classifications is an error.
- </ol>
- <p>These conventions are needed for <code>avram</code> to detect input file names
- in a general, position independent way, so that it can preload the files
- on behalf of the application. Many standard Unix utilities follow these
- <a name="index-Unix-51"></a>conventions to a large extent, the exceptions being those that employ
- non-filename arguments without distinguishing syntax, and use positional
- or other ad hoc methods of command line interpretation. A drop-in
- replacement for such an application could nevertheless be implemented
- using <code>avram</code> with an appropriate wrapper script, similar to the
- approach recommended in <a href="Example-Script.html#Example-Script">Example Script</a>, but with suitable keywords
- inserted prior to the ambiguous arguments.
- </body></html>
|