Skip to content

Commands, Arguments, Options

What is a Command?

Commands are the basic building block of CLIs in Click. They parse both the arguments and options called from the command line interface and perform actions. They also automatically create the help documentation when the --help flag is used. More detail on these can be found here.

What is an Argument?

Arguments are given after the name of the program. They are mandatory in order to run the program. Multiple arguments can be used, but the order that they are defined with in the code, is the order that they must be stated in. Further info can be found here.

What is an Option?

Options are also given after the name of the program, and as the name implies, these should be optional. However, they can be given in any order as they must be called using their name after a double dash. Additionally, they can be documented, which is shown when the --help flag is used. For more info, see here.