Von: John Porubek
Gesendet am: 16 Jul 2010 00:22:11
> I wondered about this from your previous example to me. From your
> original message (and the manpage) the format of the commandline is:
> mspdebug [options] <driver> [command ...]
> Yet your examples switch the <driver> and [options] arguments. Can I
> safely assume that the order is unimportant? I prefer <driver>
> [options] since not all options are available for all drivers ("-j",
> for example). First select the appropriate driver, then select its
> options. I hope I'm not being overly pedantic!
Usually, options which start with '-' can appear anywhere in the commandline.
Most applications first parse the commandline and note all options.
The order is only important for parameters which are not marked as what they
are.
(in your example, <driver> and [command [...]] have no 'driver' or 'command'
marker).
Some more complex programs might have separate sets of options for, e.g.,
<driver> and <command>, which maybe have the identical names.
Then the order matters. But for most it doesn't.
It's even possible that an options such as --help or --version overrides all
other parameters, Independently of where in the commandline it is found.