An arc option is a (usually optional) parameter that is referenced by name on the command line.
We can take the example from the previous page and convert both of the arguments to options by only adding 2 characters:
Now we can run it, but we must reference each argument by name (prefixed with
Notice the difference? We've added a
*, to the start of the argument list. In Python, any argument that comes after a bare
* is a keyword-only argument. In arc, this indicates that
the arguments are options.
lastname appears before
firstname in the USAGE because arc sorts optionals first
Like arguments, options also have an alternative syntax.
Taking the function definition above:
*is no longer present. When
arc.Option()is present, it is no longer required because you are explictly telling arc what kind of parameter it is. However, it is still allowed.