|
|||||
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:
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:
external-text-entity #document
rule to provide the text of the SGML document entity to be parsed.
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 |
---- |