GNU Info

Info Node: (librep.info)Command Line Options

(librep.info)Command Line Options


Next: Shell Commands Prev: Messages Up: The language
Enter node , (file) or (file)node

Command Line Options
====================

   As noted earlier any unused command line arguments are made available
to scripts through the `command-line-args' variable (Note:
Invocation).

 - Variable: command-line-args
     The list of unused command line arguments, in their original order.

   The `get-command-line-option' function may be used to scan this list
of arguments. The `rep.system' module exports this function.

 - Function: get-command-line-option option #!optional requires-arg
     Returns t if OPTION was specified on the command line (OPTION is
     typically a phrase beginning with `--').

     If REQUIRES-ARG is true, the option requires a parameter, the
     value of which is returned. If a parameter isn't supplied an error
     is signalled.

     (setq command-line-args '("--foo" "bar"))
         => ("--foo" "bar")
     (get-command-line-option "--foo" t)
         => "bar"
     command-line-args
         => ()
     
     (setq command-line-args '("--foo=bar"))
         => ("--foo=bar")
     (get-command-line-option "--foo" t)
         => "bar"
     command-line-args
         => ()


automatically generated by info2www version 1.2.2.9