12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <html lang="en">
- <head>
- <title>Parameter Mode - 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="Modes-of-Operation.html#Modes-of-Operation" title="Modes of Operation">
- <link rel="prev" href="Filter-Mode.html#Filter-Mode" title="Filter Mode">
- <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="Parameter-Mode"></a>
- <p>
- Previous: <a rel="previous" accesskey="p" href="Filter-Mode.html#Filter-Mode">Filter Mode</a>,
- Up: <a rel="up" accesskey="u" href="Modes-of-Operation.html#Modes-of-Operation">Modes of Operation</a>
- <hr>
- </div>
- <h4 class="subsection">1.2.2 Parameter Mode</h4>
- <p><a name="index-parameter-mode-24"></a>In parameter mode, the argument to the function given by the virtual
- code is a data structure containing environment variables and command
- line parameters including files, application specific options, and
- possibly standard input. The result obtained by evaluating the
- function is either a data structure representing a set of files to be
- written, which may include standard output, or a sequence of shell
- commands to be executed, or a combination of both. Parameter mode is
- indicated whenever either of these conditions is met.
- <ul>
- <li>Any of the parameter mode options appears on the
- command line preceding the first filename parameter.
- See <a href="Parameter-Mode-Options.html#Parameter-Mode-Options">Parameter Mode Options</a>.
- <li>At least one additional filename parameter or option follows the first
- filename parameter, and the option <samp><span class="option">--unparameterized</span></samp> does not
- precede it.
- </ul>
- <p class="noindent">Examples:
- <dl>
- <dt><kbd>avram --map-to-each-file prettyprinter.avm *.c *.h --extra-pretty</kbd><dd>In this example, parameter mode is indicated both by the parameter
- mode option <samp><span class="option">--map-to-each-file</span></samp> and by the presence of input
- file names and the <samp><span class="option">--extra-pretty</span></samp> option. The latter is
- specific to the hypothetical <code>prettyprinter.avm</code> virtual code
- application, as indicated by its position on the command line, and is
- therefore passed to it by <code>avram</code>.
- <br><dt><kbd>cat ~/specfile | avram reportgenerator -v - /var/log/syslog</kbd><dd>In this example, a hypothetical parameter mode application
- <code>reportgenerator</code> is able to read <samp><span class="file">~/specfile</span></samp> from standard
- input because of the <code>-</code> used as a parameter.
- <br><dt><kbd>avram --parameterized grepenv</kbd><dd>In this example, a hypothetical application that searches shell
- variables is invoked in parameter mode even with no input files or
- application specific options, because of the <samp><span class="option">--parameterized</span></samp>
- option. Parameter mode invocation is required by the application to give
- it access to the environment.
- <br><dt><kbd>avram grepenv --search-targets=PATH,MANPATH</kbd><dd>This example shows an application specific option with both a keyword
- and a parameter list. They suffice to indicate parameter mode without
- an explicit <samp><span class="option">--parameterized</span></samp> option.
- </dl>
- </body></html>
|