Command-Line-Syntax.html 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <html lang="en">
  2. <head>
  3. <title>Command Line Syntax - avram - a virtual machine code interpreter</title>
  4. <meta http-equiv="Content-Type" content="text/html">
  5. <meta name="description" content="avram - a virtual machine code interpreter">
  6. <meta name="generator" content="makeinfo 4.13">
  7. <link title="Top" rel="start" href="index.html#Top">
  8. <link rel="up" href="User-Manual.html#User-Manual" title="User Manual">
  9. <link rel="prev" href="Parameter-Mode-Options.html#Parameter-Mode-Options" title="Parameter Mode Options">
  10. <link rel="next" href="Diagnostics.html#Diagnostics" title="Diagnostics">
  11. <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
  12. <meta http-equiv="Content-Style-Type" content="text/css">
  13. <style type="text/css"><!--
  14. pre.display { font-family:inherit }
  15. pre.format { font-family:inherit }
  16. pre.smalldisplay { font-family:inherit; font-size:smaller }
  17. pre.smallformat { font-family:inherit; font-size:smaller }
  18. pre.smallexample { font-size:smaller }
  19. pre.smalllisp { font-size:smaller }
  20. span.sc { font-variant:small-caps }
  21. span.roman { font-family:serif; font-weight:normal; }
  22. span.sansserif { font-family:sans-serif; font-weight:normal; }
  23. --></style>
  24. </head>
  25. <body>
  26. <div class="node">
  27. <a name="Command-Line-Syntax"></a>
  28. <p>
  29. Next:&nbsp;<a rel="next" accesskey="n" href="Diagnostics.html#Diagnostics">Diagnostics</a>,
  30. Previous:&nbsp;<a rel="previous" accesskey="p" href="Parameter-Mode-Options.html#Parameter-Mode-Options">Parameter Mode Options</a>,
  31. Up:&nbsp;<a rel="up" accesskey="u" href="User-Manual.html#User-Manual">User Manual</a>
  32. <hr>
  33. </div>
  34. <h3 class="section">1.5 Command Line Syntax</h3>
  35. <p><a name="index-command-line-46"></a>The command line parameters that follow the virtual code file name
  36. when <code>avram</code> is used in parameter mode (<a href="Parameter-Mode.html#Parameter-Mode">Parameter Mode</a>) are dependent on the
  37. specific application. However, all supported applications are
  38. constrained for implementation reasons to observe certain uniform
  39. conventions regarding their command line parameters, which are
  40. documented here to avoid needless duplication.
  41. <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
  42. space. Arguments containing white space or special characters used by
  43. the shell must be quoted or protected as usual. File names with wild
  44. cards in them are expanded by the shell before <code>avram</code> sees them.
  45. <p><code>avram</code> then extracts from the sequence of arguments a sequence of
  46. filenames and a sequence of options. Each option consists of a keyword and an
  47. optional parameter list. Filenames, keywords, and parameter lists are
  48. distinguished according to the following criteria.
  49. <ol type=1 start=1>
  50. <li>An argument is treated as a keyword iff it meets these three
  51. conditions.
  52. <ol type=a start=1>
  53. <li>It starts with a dash.
  54. <li>It doesn't contain an equals sign.
  55. <li>It doesn't consist solely of a dash.
  56. </ol>
  57. <li>An argument is treated as a parameter list iff it meets these four
  58. conditions.
  59. <ol type=a start=1>
  60. <li>It doesn't begin with a dash.
  61. <li>It either begins with an equals sign or doesn't contain one.
  62. <li>It immediately follows an argument beginning with a dash, not
  63. containing an equals sign and not consisting solely of a dash.
  64. <li>At least one of the following is true.
  65. <ol type=1 start=1>
  66. <li>It doesn't contain a period, tilde, or path separator.
  67. <a name="index-path-separators-50"></a><li>It contains a comma.
  68. <li>It can be interpreted as a C formatted floating point number.
  69. </ol>
  70. </ol>
  71. <li>An argument is treated as an input file name iff it meets these four
  72. conditions.
  73. <ol type=a start=1>
  74. <li>It doesn't begin with a dash.
  75. <li>It doesn't contain an equals sign.
  76. <li>It doesn't contain a comma.
  77. <li>At least one of the following is true.
  78. <ol type=1 start=1>
  79. <li>It contains a period, tilde, or path separator.
  80. <li>It doesn't immediately follow an argument beginning with a dash, not
  81. consisting solely of a dash, and not containing an equals sign.
  82. </ol>
  83. </ol>
  84. <li>If an argument contains an equals sign but doesn't begin with one,
  85. the part on the left of the first equals sign is treated as a
  86. keyword and the part on the right is treated as a parameter list.
  87. <li>An argument consisting solely of a dash is taken to represent the
  88. standard input file.
  89. <li>An argument not fitting any of the above classifications is an error.
  90. </ol>
  91. <p>These conventions are needed for <code>avram</code> to detect input file names
  92. in a general, position independent way, so that it can preload the files
  93. on behalf of the application. Many standard Unix utilities follow these
  94. <a name="index-Unix-51"></a>conventions to a large extent, the exceptions being those that employ
  95. non-filename arguments without distinguishing syntax, and use positional
  96. or other ad hoc methods of command line interpretation. A drop-in
  97. replacement for such an application could nevertheless be implemented
  98. using <code>avram</code> with an appropriate wrapper script, similar to the
  99. approach recommended in <a href="Example-Script.html#Example-Script">Example Script</a>, but with suitable keywords
  100. inserted prior to the ambiguous arguments.
  101. </body></html>