From 703cb3aa177f8df4b117d863387a3b463cadfef4 Mon Sep 17 00:00:00 2001 From: Tib3rius <48113936+Tib3rius@users.noreply.github.com> Date: Tue, 10 May 2022 01:49:57 -0400 Subject: [PATCH] Updated API Documentation (markdown) --- API-Documentation.md | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/API-Documentation.md b/API-Documentation.md index 7fd7d3e..9acd572 100644 --- a/API-Documentation.md +++ b/API-Documentation.md @@ -175,6 +175,8 @@ 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. +This method should only be used in the configure() method of a plugin. + **Example** ``` Command Line: --foo.bar=baz @@ -186,6 +188,8 @@ 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. +This method should only be used in the configure() method of a plugin. + **Example** ``` Code: add_constant_option("bar", "baz") @@ -198,6 +202,8 @@ 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. +This method should only be used in the configure() method of a plugin. + **Example** ``` Command Line: --foo.bar @@ -209,6 +215,8 @@ 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. +This method should only be used in the configure() method of a plugin. + **Example** ``` Command Line: --foo.bar @@ -220,6 +228,8 @@ 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. +This method should only be used in the configure() method of a plugin. + **Example** ``` Command Line: --foo.bar baz1 baz2 baz3 @@ -231,9 +241,18 @@ 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. +This method should only be used in the configure() method of a plugin. + **Example** ``` Code: add_choice_option("bar", ["baz1", "baz2", "baz3"]) Command Line: --foo.bar baz2 Resulting Value: baz2 (string) -``` \ No newline at end of file +``` + +*** + +#### get_option(name) +The `get_option` method is used to retrieve the value of an option (either set by the user or the default) that the plugin has previously configured. The `name` argument should be the same value as the `name` argument of the original option. + +This method should only be used in the run() coroutine of a plugin. \ No newline at end of file