# FILE: commandline.tcl # # [Oc_CommandLine] manages the parsing of the command line arguments to # an application. # # Normally, the command line arguments are stored in the global list # variable $argv. The parsing of the command line arguments is done by # evaluating [Oc_CommandLine Parse $argv] at global scope. # # The global list variable $argv holds a list of strings. # [Oc_CommandLine Parse $argv] searches through $argv, one string at a # time, looking for an "option". [Oc_CommandLine Parse] can distinguish # an "option" from other strings because all options begin with a common # prefix string, called the "switch". By default, the switch is "-". # # The command [Oc_CommandLine Switch] returns the current switch used by # [Oc_CommandLine] to tell an option from a non-option, and the command # [Oc_CommandLine Switch $string] instructs [Oc_CommandLine] to use # $string as the switch. # # Prior to evaluating [Oc_CommandLine Parse], an application will use # the command [Oc_CommandLine Option] to define each command line option # it wishes the parser to recognize, and how it wants the parser to # process them. Usage is: # # Oc_CommandLine Option