contentsconceptssyntaxlibrariessampleserrorsindex
Full text search
built-in variable   #command-line-names    
  Related Syntax   Related Concepts  

Purpose

A built-in, global, unkeyed, read-only stream shelf used to access file names from the command line.

All words on the command line are recognized as either "names", command-line options, or errors. Only command-line names are placed in the #command-line-names shelf. The shelf contains any "words" on the command line not recognized as OmniMark command-line options. The following are the rules for distinguishing command-line names from command-line options:

  1. Any exisiting OmniMark command-line option and its arguments are considered to be command-line options.
  2. Any argument that begins with a single dash ("-") is reserved for future command-line options; the argument will be treated as an error. A word that begins with two dashes ("--") is recognized as a name.

If no words on the command line are recognized as names, the #command-line-names shelf has no items.

Variables initialized on the command line are often referred to as "command-line arguments" (such as a stream value set using "-d"). These are different from the names on the #command-line-names shelf. Command-line arguments are entered on the command line with an identification of the global shelf for which they set parameters, while the #command-line-names shelf is the set of "unrecognized" names on the command line.

#command-line-names is available to all types of OmniMark programs. It can be used to control input to process programs and cross-translations.

You can use #command-line-names to explicitly process the arguments on the command line. This allows you to:

The following example demonstrates how #command-line-names enables you to have names on the OmniMark command line interpreted as the URLs for HTML documents. The external-text-entity #document rule uses submit to make sure that find rules can be used to convert the HTML into appropriately conforming SGML. An externally defined "source" function called get-url is assumed to be available for getting the text of the HTML files via the Internet.

  context-translate

  external-text-entity #document
     repeat over #command-line-names
        submit get-url ("http://" || #command-line-names)
     again

  Related Syntax
   #document
   external-text-entity #document
 
Related Concepts
   XML/SGML parser: controlling input
 
----  

Top [CONTENTS] [CONCEPTS] [SYNTAX] [LIBRARIES] [SAMPLES] [ERRORS] [INDEX]

Generated: April 21, 1999 at 2:00:59 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © OmniMark Technologies Corporation, 1988-1999.