Skip to content


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:

import arc

def hello(*, firstname: str, lastname: str | None):
    name = firstname
    if lastname:
        name += f" {lastname}"

    arc.print(f"Hello, {name}! Hope you have a wonderful day!")


Now we can run it, but we must reference each argument by name (prefixed with --)

$ python --firstname Joesph --lastname Joestar
Hello, Joesph Joestar! Hope you have a wonderful day!

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.


$ python --help
USAGE [-h] [--lastname LASTNAME] --firstname FIRSTNAME

    --help (-h)  Displays this help message


lastname appears before firstname in the USAGE because arc sorts optionals first

Alternative Syntax

Like arguments, options also have an alternative syntax.

Taking the function definition above:

def hello(*, firstname: str, lastname: str | None):
We could also have written it as:
def hello(
    firstname: str = arc.Option(),
    lastname: str | None = arc.Option()
Note that the base * 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.

Check the reference for a full rundown of the capabilities