Updated API Documentation (markdown)

Tib3rius 2022-05-10 01:41:50 -04:00
parent 8fe78179f4
commit b2f39fd18f
1 changed files with 52 additions and 1 deletions

@ -175,14 +175,65 @@ The `tags` attribute is a list of tags that apply to the plugin. By default, the
#### add_option(name, default=None, help=None)
The `add_option` method sets a command-line option for the plugin to use, where the value set to the option is stored if the option is used. The `name` argument is used as part of the command-line option. For example, if a plugin called "Foo" added an option with the `name` "bar", the command-line option would be --foo.bar. The `default` argument is optional, but if set, will return if the user does not specify the command-line option. The `help` argument is also optional, but recommended to let users know what the option is to be used for.
**Example**
```
Command Line: --foo.bar=baz
Resulting Value: baz (string)
```
***
#### add_constant_option(name, const, default=None, help=None)
The `add_constant_option` method sets a command-line option for the plugin to use, where the value set to the `const` argument is stored if the option is used. The `name` argument is used as part of the command-line option. For example, if a plugin called "Foo" added an option with the `name` "bar", the command-line option would be --foo.bar. The `default` argument is optional, but if set, will return if the user does not specify the command-line option. The `help` argument is also optional, but recommended to let users know what the option is to be used for.
**Example**
```
Code: add_constant_option("bar", "baz")
Command Line: --foo.bar
Resulting Value: baz (string)
```
***
#### add_true_option(name, help=None)
The `add_true_option` method sets a command-line option for the plugin to use, where the boolean `True` is stored if the option is used. The `name` argument is used as part of the command-line option. For example, if a plugin called "Foo" added an option with the `name` "bar", the command-line option would be --foo.bar. The `help` argument is also optional, but recommended to let users know what the option is to be used for.
**Example**
```
Command Line: --foo.bar
Resulting Value: True (boolean)
```
***
#### add_false_option(name, help=None)
The `add_false_option` method sets a command-line option for the plugin to use, where the boolean `False` is stored if the option is used. The `name` argument is used as part of the command-line option. For example, if a plugin called "Foo" added an option with the `name` "bar", the command-line option would be --foo.bar. The `help` argument is also optional, but recommended to let users know what the option is to be used for.
**Example**
```
Command Line: --foo.bar
Resulting Value: False (boolean)
```
***
#### add_list_option(name, default=None, help=None)
The `add_list_option` method sets a command-line option for the plugin to use, where multiple space separated values are stored in a list is stored if the option is used. The `name` argument is used as part of the command-line option. For example, if a plugin called "Foo" added an option with the `name` "bar", the command-line option would be --foo.bar. The `help` argument is also optional, but recommended to let users know what the option is to be used for.
The `add_list_option` method sets a command-line option for the plugin to use, where multiple space separated values are stored in a list is stored if the option is used. The `name` argument is used as part of the command-line option. For example, if a plugin called "Foo" added an option with the `name` "bar", the command-line option would be --foo.bar. The `help` argument is also optional, but recommended to let users know what the option is to be used for.
**Example**
```
Command Line: --foo.bar baz1 baz2 baz3
Resulting Value: ["baz1", "baz2", "baz3"] (list of strings)
```
***
#### add_choice_option(name, choices, default=None, help=None)
The `add_choice_option` method sets a command-line option for the plugin to use, where the value set to the option is stored if the option is used, provided the value is within a predefined set of valid values. The `name` argument is used as part of the command-line option. For example, if a plugin called "Foo" added an option with the `name` "bar", the command-line option would be --foo.bar. The `choices` argument is a list of valid values the user can choose from. The `help` argument is also optional, but recommended to let users know what the option is to be used for.
**Example**
```
Code: add_choice_option("bar", ["baz1", "baz2", "baz3"])
Command Line: --foo.bar baz2
Resulting Value: baz2 (string)
```