In this page we will lay out how certain input is processed and how the parser handles some edge cases.

Defining arguments, commands and flags

We define arguments as any distinct element of a command line command. For example in the command https://madladsquad.com/app hello --world the arguments are hello and --world

Commands are arguments that change the behaviour of your application. The de facto standard for command line interfaces is for commands to be plain words. Commands can also have short forms in the form of single characters. In the previous example, hello would be a command. An example of a short command is npm i where i is equivalent to typing install

Flags are arguments that change the behaviour of one of the current commands. The de facto standard for flags is to prefix them with -- if they are long argumens(like --flag) or with - for short arguments(like -f = --flag). Multiple short flags can be batched into a single argument by adding other flags with short names to the end of a short flag(like -aBcD). A flag has to be tied to a specific command and its purpose is to add customisability to it.

Boolean arguments

Boolean arguments are used to enable or disable an application feature. For example in git clone, the clone command is a boolean command that enables the cloning feature.

We support the following long name syntax for boolean arguments:

We also support the following short arguments:

The following edge cases are handled by defaulting to enabling/toggling the flag:

String arguments

String arguments are arguments that receive a string value. For example: git config user.name my_name where user.name is a string argument.

We support the following long name syntax:

We also support the following short forms:

We handle the following edge cases as follows:

Array arguments

Array arguments are the same as string arguments, but they accept multiple strings.

We support the following long name syntax:

We also support the following short syntax:

We also handle the following edge cases: