The Standard ML Basis Library


The CommandLine structure

The CommandLine structure provides access to the name and arguments used to invoke the currently running program.


Synopsis

signature COMMAND_LINE
structure CommandLine : COMMAND_LINE

Interface

val name : unit -> string
val arguments : unit -> string

Description

name ()
returns the name used to invoke the current program.

arguments ()
returns the argument list used to invoke the current program.
Implementation note:

The arguments returned may be only a subset of the arguments actually supplied by the user, since an implementation's run-time system may consume some of them.




Discussion

The precise semantics of the above operations are OS- and implementation-specific. For example, name might return the full pathname or just the base name. See also the implementation note under arguments.

Implementations may provide a mechanism for taking a function and producing a stand-alone executable. If such a mechanism is provided, the type of the function being exported must be

  (string * string list) -> OS.Process.status
When the stand-alone executable is invoked, the function is called with a first argument equal to name () and a second argument equal to arguments ().
[ INDEX | TOP | Parent | Root ]

Last Modified January 21, 1997
Copyright © 1996 AT&T