From c24488a99ed3f506eb6faa8966fa9e48415bb381 Mon Sep 17 00:00:00 2001 From: Grzegorz Krason Date: Mon, 30 Dec 2024 10:41:38 +0100 Subject: [PATCH 1/5] Sort options --- linodecli/__init__.py | 2 ++ linodecli/baked/operation.py | 2 ++ linodecli/help_formatter.py | 7 +++++++ linodecli/plugins/firewall-editor.py | 8 +++++++- linodecli/plugins/get-kubeconfig.py | 7 ++++++- linodecli/plugins/image-upload.py | 7 ++++++- linodecli/plugins/metadata.py | 7 ++++++- linodecli/plugins/obj/__init__.py | 29 ++++++++++++++++++++++++---- linodecli/plugins/obj/buckets.py | 15 ++++++++++++-- linodecli/plugins/obj/list.py | 17 ++++++++++++++-- linodecli/plugins/obj/objects.py | 22 ++++++++++++++++++--- linodecli/plugins/obj/website.py | 22 ++++++++++++++++++--- linodecli/plugins/ssh.py | 7 ++++++- 13 files changed, 133 insertions(+), 19 deletions(-) create mode 100644 linodecli/help_formatter.py diff --git a/linodecli/__init__.py b/linodecli/__init__.py index 3fa192e8c..41cdc791a 100755 --- a/linodecli/__init__.py +++ b/linodecli/__init__.py @@ -19,6 +19,7 @@ from .cli import CLI from .completion import get_completions from .configuration import ENV_TOKEN_NAME +from .help_formatter import SortingHelpFormatter from .help_pages import ( HELP_TOPICS, print_help_action, @@ -61,6 +62,7 @@ def main(): # pylint: disable=too-many-branches,too-many-statements parser = argparse.ArgumentParser( "linode-cli", add_help=False, + formatter_class=SortingHelpFormatter, description="The Linode Command Line Interface.\n\nAliases: lin, linode", ) parsed, args = register_args(parser).parse_known_args() diff --git a/linodecli/baked/operation.py b/linodecli/baked/operation.py index 3eb3234e3..bde52c00b 100644 --- a/linodecli/baked/operation.py +++ b/linodecli/baked/operation.py @@ -21,6 +21,7 @@ from linodecli.baked.request import OpenAPIFilteringRequest, OpenAPIRequest from linodecli.baked.response import OpenAPIResponse from linodecli.exit_codes import ExitCodes +from linodecli.help_formatter import SortingHelpFormatter from linodecli.output.output_handler import OutputHandler from linodecli.overrides import OUTPUT_OVERRIDES @@ -811,6 +812,7 @@ def parse_args(self, args: Any) -> argparse.Namespace: # build an argparse parser = argparse.ArgumentParser( prog=f"linode-cli {self.command} {self.action}", + formatter_class=SortingHelpFormatter, description=self.summary, ) for param in self.params: diff --git a/linodecli/help_formatter.py b/linodecli/help_formatter.py new file mode 100644 index 000000000..24613f74c --- /dev/null +++ b/linodecli/help_formatter.py @@ -0,0 +1,7 @@ +from argparse import HelpFormatter +from operator import attrgetter + +class SortingHelpFormatter(HelpFormatter): + def add_arguments(self, actions): + actions = sorted(actions, key=attrgetter('option_strings')) + super(SortingHelpFormatter, self).add_arguments(actions) diff --git a/linodecli/plugins/firewall-editor.py b/linodecli/plugins/firewall-editor.py index f7c1f494d..d9e53b5af 100644 --- a/linodecli/plugins/firewall-editor.py +++ b/linodecli/plugins/firewall-editor.py @@ -15,6 +15,7 @@ from rich.table import Table from linodecli.exit_codes import ExitCodes +from linodecli.help_formatter import SortingHelpFormatter from linodecli.plugins import inherit_plugin_args BOLD = "\033[1m" @@ -581,8 +582,13 @@ def call(args, context): Invokes the Interactive Firewall Plugin """ parser = inherit_plugin_args( - argparse.ArgumentParser("firewall-editor", add_help=True) + argparse.ArgumentParser( + "firewall-editor", + add_help=True, + formatter_class=SortingHelpFormatter + ) ) + parser.add_argument("firewall_id", help="The ID of the firewall to edit.") parsed = parser.parse_args(args) diff --git a/linodecli/plugins/get-kubeconfig.py b/linodecli/plugins/get-kubeconfig.py index 1652b999f..207ebbef0 100644 --- a/linodecli/plugins/get-kubeconfig.py +++ b/linodecli/plugins/get-kubeconfig.py @@ -14,6 +14,7 @@ import yaml from linodecli.exit_codes import ExitCodes +from linodecli.help_formatter import SortingHelpFormatter PLUGIN_BASE = "linode-cli get-kubeconfig" @@ -22,7 +23,11 @@ def call(args, context): """ The entrypoint for this plugin """ - parser = argparse.ArgumentParser(PLUGIN_BASE, add_help=True) + parser = argparse.ArgumentParser( + PLUGIN_BASE, + add_help=True, + formatter_class=SortingHelpFormatter + ) group = parser.add_mutually_exclusive_group() diff --git a/linodecli/plugins/image-upload.py b/linodecli/plugins/image-upload.py index 19b1068c5..6ef01e02e 100644 --- a/linodecli/plugins/image-upload.py +++ b/linodecli/plugins/image-upload.py @@ -15,6 +15,7 @@ import requests from linodecli.exit_codes import ExitCodes +from linodecli.help_formatter import SortingHelpFormatter from linodecli.plugins import inherit_plugin_args PLUGIN_BASE = "linode-cli image-upload" @@ -68,7 +69,11 @@ def call(args, context): The entrypoint for this plugin """ parser = inherit_plugin_args( - argparse.ArgumentParser(PLUGIN_BASE, add_help=True) + argparse.ArgumentParser( + PLUGIN_BASE, + add_help=True, + formatter_class=SortingHelpFormatter + ) ) parser.add_argument( diff --git a/linodecli/plugins/metadata.py b/linodecli/plugins/metadata.py index 8d13e1403..f9805ef45 100644 --- a/linodecli/plugins/metadata.py +++ b/linodecli/plugins/metadata.py @@ -17,6 +17,7 @@ from rich.table import Table from linodecli.exit_codes import ExitCodes +from linodecli.help_formatter import SortingHelpFormatter from linodecli.helpers import register_debug_arg PLUGIN_BASE = "linode-cli metadata" @@ -184,7 +185,11 @@ def get_metadata_parser(): """ Builds argparser for Metadata plug-in """ - parser = ArgumentParser(PLUGIN_BASE, add_help=False) + parser = ArgumentParser( + PLUGIN_BASE, + add_help=False, + formatter_class=SortingHelpFormatter + ) register_debug_arg(parser) diff --git a/linodecli/plugins/obj/__init__.py b/linodecli/plugins/obj/__init__.py index 9e613ff7a..65bbe77fa 100644 --- a/linodecli/plugins/obj/__init__.py +++ b/linodecli/plugins/obj/__init__.py @@ -20,6 +20,7 @@ from linodecli.configuration import _do_get_request from linodecli.configuration.helpers import _default_text_input from linodecli.exit_codes import ExitCodes +from linodecli.help_formatter import SortingHelpFormatter from linodecli.plugins import PluginContext, inherit_plugin_args from linodecli.plugins.obj.buckets import create_bucket, delete_bucket from linodecli.plugins.obj.config import ( @@ -67,7 +68,11 @@ def generate_url(get_client, args, **kwargs): # pylint: disable=unused-argument """ Generates a URL to an object """ - parser = inherit_plugin_args(ArgumentParser(PLUGIN_BASE + " signurl")) + parser = inherit_plugin_args( + ArgumentParser( + PLUGIN_BASE + " signurl", + formatter_class=SortingHelpFormatter) + ) parser.add_argument( "bucket", @@ -118,7 +123,12 @@ def set_acl(get_client, args, **kwargs): # pylint: disable=unused-argument """ Modify Access Control List for a Bucket or Objects """ - parser = inherit_plugin_args(ArgumentParser(PLUGIN_BASE + " setacl")) + parser = inherit_plugin_args( + ArgumentParser( + PLUGIN_BASE + " setacl", + formatter_class=SortingHelpFormatter + ) + ) parser.add_argument( "bucket", metavar="BUCKET", type=str, help="The bucket to modify." @@ -181,7 +191,12 @@ def show_usage(get_client, args, **kwargs): # pylint: disable=unused-argument """ Shows space used by all buckets in this cluster, and total space """ - parser = inherit_plugin_args(ArgumentParser(PLUGIN_BASE + " du")) + parser = inherit_plugin_args( + ArgumentParser( + PLUGIN_BASE + " du", + formatter_class=SortingHelpFormatter + ) + ) parser.add_argument( "bucket", @@ -286,7 +301,13 @@ def get_obj_args_parser(): """ Initialize and return the argument parser for the obj plug-in. """ - parser = inherit_plugin_args(ArgumentParser(PLUGIN_BASE, add_help=False)) + parser = inherit_plugin_args( + ArgumentParser( + PLUGIN_BASE, + add_help=False, + formatter_class=SortingHelpFormatter + ) + ) parser.add_argument( "command", diff --git a/linodecli/plugins/obj/buckets.py b/linodecli/plugins/obj/buckets.py index b21b7129f..37ebc4d8c 100644 --- a/linodecli/plugins/obj/buckets.py +++ b/linodecli/plugins/obj/buckets.py @@ -6,6 +6,7 @@ from argparse import ArgumentParser from linodecli.exit_codes import ExitCodes +from linodecli.help_formatter import SortingHelpFormatter from linodecli.plugins import inherit_plugin_args from linodecli.plugins.obj.config import PLUGIN_BASE from linodecli.plugins.obj.helpers import _delete_all_objects @@ -17,7 +18,12 @@ def create_bucket( """ Creates a new bucket """ - parser = inherit_plugin_args(ArgumentParser(PLUGIN_BASE + " mb")) + parser = inherit_plugin_args( + ArgumentParser( + PLUGIN_BASE + " mb", + formatter_class=SortingHelpFormatter + ) + ) parser.add_argument( "name", @@ -41,7 +47,12 @@ def delete_bucket( """ Deletes a bucket """ - parser = inherit_plugin_args(ArgumentParser(PLUGIN_BASE + " rb")) + parser = inherit_plugin_args( + ArgumentParser( + PLUGIN_BASE + " rb", + formatter_class=SortingHelpFormatter + ) + ) parser.add_argument( "name", diff --git a/linodecli/plugins/obj/list.py b/linodecli/plugins/obj/list.py index 6a6184da7..89fce8152 100644 --- a/linodecli/plugins/obj/list.py +++ b/linodecli/plugins/obj/list.py @@ -8,6 +8,7 @@ from rich import print as rprint from linodecli.exit_codes import ExitCodes +from linodecli.help_formatter import SortingHelpFormatter from linodecli.helpers import register_pagination_args_shared from linodecli.plugins import inherit_plugin_args from linodecli.plugins.obj.config import PLUGIN_BASE @@ -31,7 +32,13 @@ def list_objects_or_buckets( """ Lists buckets or objects """ - parser = inherit_plugin_args(ArgumentParser(PLUGIN_BASE + " ls")) + parser = inherit_plugin_args( + ArgumentParser( + PLUGIN_BASE + " ls", + formatter_class=SortingHelpFormatter + ) + ) + register_pagination_args_shared(parser) parser.add_argument( @@ -130,7 +137,13 @@ def list_all_objects( Lists all objects in all buckets """ # this is for printing help when --help is in the args - parser = inherit_plugin_args(ArgumentParser(PLUGIN_BASE + " la")) + parser = inherit_plugin_args( + ArgumentParser( + PLUGIN_BASE + " la", + formatter_class=SortingHelpFormatter + ) + ) + register_pagination_args_shared(parser) parsed = parser.parse_args(args) diff --git a/linodecli/plugins/obj/objects.py b/linodecli/plugins/obj/objects.py index f3e2513cf..e12bc9273 100644 --- a/linodecli/plugins/obj/objects.py +++ b/linodecli/plugins/obj/objects.py @@ -17,6 +17,7 @@ pass from linodecli.exit_codes import ExitCodes +from linodecli.help_formatter import SortingHelpFormatter from linodecli.helpers import expand_globs from linodecli.plugins import inherit_plugin_args from linodecli.plugins.obj.config import ( @@ -36,7 +37,12 @@ def upload_object( """ Uploads an object to object storage """ - parser = inherit_plugin_args(ArgumentParser(PLUGIN_BASE + " put")) + parser = inherit_plugin_args( + ArgumentParser( + PLUGIN_BASE + " put", + formatter_class=SortingHelpFormatter + ) + ) parser.add_argument( "file", metavar="FILE", type=str, nargs="+", help="The files to upload." @@ -126,7 +132,12 @@ def get_object( """ Retrieves an uploaded object and writes it to a file """ - parser = inherit_plugin_args(ArgumentParser(PLUGIN_BASE + " get")) + parser = inherit_plugin_args( + ArgumentParser( + PLUGIN_BASE + " get", + formatter_class=SortingHelpFormatter + ) + ) parser.add_argument( "bucket", metavar="BUCKET", type=str, help="The bucket the file is in." @@ -201,7 +212,12 @@ def delete_object( """ Removes a file from a bucket """ - parser = inherit_plugin_args(ArgumentParser(PLUGIN_BASE + " del")) + parser = inherit_plugin_args( + ArgumentParser( + PLUGIN_BASE + " del", + formatter_class=SortingHelpFormatter + ) + ) parser.add_argument( "bucket", metavar="BUCKET", type=str, help="The bucket to delete from." diff --git a/linodecli/plugins/obj/website.py b/linodecli/plugins/obj/website.py index 9d55be173..54e600f92 100644 --- a/linodecli/plugins/obj/website.py +++ b/linodecli/plugins/obj/website.py @@ -4,6 +4,7 @@ from argparse import ArgumentParser +from linodecli.help_formatter import SortingHelpFormatter from linodecli.plugins import inherit_plugin_args from linodecli.plugins.obj.config import BASE_WEBSITE_TEMPLATE, PLUGIN_BASE @@ -14,7 +15,12 @@ def enable_static_site( """ Turns a bucket into a static website """ - parser = inherit_plugin_args(ArgumentParser(PLUGIN_BASE + " ws-create")) + parser = inherit_plugin_args( + ArgumentParser( + PLUGIN_BASE + " ws-create", + formatter_class=SortingHelpFormatter + ) + ) parser.add_argument( "bucket", @@ -74,7 +80,12 @@ def static_site_info( """ Returns info about a configured static site """ - parser = inherit_plugin_args(ArgumentParser(PLUGIN_BASE + " ws-info")) + parser = inherit_plugin_args( + ArgumentParser( + PLUGIN_BASE + " ws-info", + formatter_class=SortingHelpFormatter + ) + ) parser.add_argument( "bucket", @@ -109,7 +120,12 @@ def disable_static_site( """ Disables static site for a bucket """ - parser = inherit_plugin_args(ArgumentParser(PLUGIN_BASE + " du")) + parser = inherit_plugin_args( + ArgumentParser( + PLUGIN_BASE + " du", + formatter_class=SortingHelpFormatter + ) + ) parser.add_argument( "bucket", diff --git a/linodecli/plugins/ssh.py b/linodecli/plugins/ssh.py index 2ed53cbdb..2536e1cf0 100644 --- a/linodecli/plugins/ssh.py +++ b/linodecli/plugins/ssh.py @@ -16,6 +16,7 @@ from typing import Any, Dict, Optional, Tuple from linodecli.exit_codes import ExitCodes +from linodecli.help_formatter import SortingHelpFormatter from linodecli.plugins import inherit_plugin_args @@ -33,7 +34,11 @@ def call(args, context): # pylint: disable=too-many-branches sys.exit(ExitCodes.REQUEST_FAILED) parser = inherit_plugin_args( - argparse.ArgumentParser("linode-cli ssh", add_help=True) + argparse.ArgumentParser( + "linode-cli ssh", + add_help=True, + formatter_class=SortingHelpFormatter + ) ) parser.add_argument( From 89a1c2eae451a3a1ec87a58e6ea8eb6dbe4cc4e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20Kraso=C5=84?= Date: Wed, 5 Mar 2025 15:45:39 +0100 Subject: [PATCH 2/5] Update linodecli/help_formatter.py Co-authored-by: Zhiwei Liang <121905282+zliang-akamai@users.noreply.github.com> --- linodecli/help_formatter.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/linodecli/help_formatter.py b/linodecli/help_formatter.py index 24613f74c..ee2674e5f 100644 --- a/linodecli/help_formatter.py +++ b/linodecli/help_formatter.py @@ -1,3 +1,7 @@ +""" +Contains sorting formatter for help menu. +""" + from argparse import HelpFormatter from operator import attrgetter From 00810aa9fd17cbdf186cc726c3ed45a274c763af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20Kraso=C5=84?= Date: Wed, 5 Mar 2025 15:45:46 +0100 Subject: [PATCH 3/5] Update linodecli/help_formatter.py Co-authored-by: Zhiwei Liang <121905282+zliang-akamai@users.noreply.github.com> --- linodecli/help_formatter.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/linodecli/help_formatter.py b/linodecli/help_formatter.py index ee2674e5f..4ffd21148 100644 --- a/linodecli/help_formatter.py +++ b/linodecli/help_formatter.py @@ -6,6 +6,10 @@ from operator import attrgetter class SortingHelpFormatter(HelpFormatter): + """ + The formatter class for help menu. + """ + def add_arguments(self, actions): actions = sorted(actions, key=attrgetter('option_strings')) super(SortingHelpFormatter, self).add_arguments(actions) From 290dbbf71572b36f00a248b52505be1f5816f68d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20Kraso=C5=84?= Date: Wed, 5 Mar 2025 15:45:52 +0100 Subject: [PATCH 4/5] Update linodecli/help_formatter.py Co-authored-by: Zhiwei Liang <121905282+zliang-akamai@users.noreply.github.com> --- linodecli/help_formatter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linodecli/help_formatter.py b/linodecli/help_formatter.py index 4ffd21148..fb51e635d 100644 --- a/linodecli/help_formatter.py +++ b/linodecli/help_formatter.py @@ -12,4 +12,4 @@ class SortingHelpFormatter(HelpFormatter): def add_arguments(self, actions): actions = sorted(actions, key=attrgetter('option_strings')) - super(SortingHelpFormatter, self).add_arguments(actions) + super().add_arguments(actions) From e79389ead5f653fdf85680afe23c104273bf5a3d Mon Sep 17 00:00:00 2001 From: Zhiwei Liang Date: Wed, 27 Aug 2025 16:40:28 -0400 Subject: [PATCH 5/5] make format --- linodecli/help_formatter.py | 3 ++- linodecli/plugins/firewall-editor.py | 2 +- linodecli/plugins/get-kubeconfig.py | 4 +--- linodecli/plugins/image-upload.py | 4 +--- linodecli/plugins/metadata.py | 4 +--- linodecli/plugins/obj/__init__.py | 14 +++++--------- linodecli/plugins/obj/buckets.py | 6 ++---- linodecli/plugins/obj/list.py | 6 ++---- linodecli/plugins/obj/objects.py | 9 +++------ linodecli/plugins/obj/website.py | 9 +++------ linodecli/plugins/ssh.py | 2 +- 11 files changed, 22 insertions(+), 41 deletions(-) diff --git a/linodecli/help_formatter.py b/linodecli/help_formatter.py index fb51e635d..00845cc39 100644 --- a/linodecli/help_formatter.py +++ b/linodecli/help_formatter.py @@ -5,11 +5,12 @@ from argparse import HelpFormatter from operator import attrgetter + class SortingHelpFormatter(HelpFormatter): """ The formatter class for help menu. """ def add_arguments(self, actions): - actions = sorted(actions, key=attrgetter('option_strings')) + actions = sorted(actions, key=attrgetter("option_strings")) super().add_arguments(actions) diff --git a/linodecli/plugins/firewall-editor.py b/linodecli/plugins/firewall-editor.py index d9e53b5af..f7f4b7c1d 100644 --- a/linodecli/plugins/firewall-editor.py +++ b/linodecli/plugins/firewall-editor.py @@ -585,7 +585,7 @@ def call(args, context): argparse.ArgumentParser( "firewall-editor", add_help=True, - formatter_class=SortingHelpFormatter + formatter_class=SortingHelpFormatter, ) ) diff --git a/linodecli/plugins/get-kubeconfig.py b/linodecli/plugins/get-kubeconfig.py index 969a8bf19..d7af0249a 100644 --- a/linodecli/plugins/get-kubeconfig.py +++ b/linodecli/plugins/get-kubeconfig.py @@ -24,9 +24,7 @@ def call(args, context): The entrypoint for this plugin """ parser = argparse.ArgumentParser( - PLUGIN_BASE, - add_help=True, - formatter_class=SortingHelpFormatter + PLUGIN_BASE, add_help=True, formatter_class=SortingHelpFormatter ) group = parser.add_mutually_exclusive_group() diff --git a/linodecli/plugins/image-upload.py b/linodecli/plugins/image-upload.py index 6ef01e02e..f6501d2cc 100644 --- a/linodecli/plugins/image-upload.py +++ b/linodecli/plugins/image-upload.py @@ -70,9 +70,7 @@ def call(args, context): """ parser = inherit_plugin_args( argparse.ArgumentParser( - PLUGIN_BASE, - add_help=True, - formatter_class=SortingHelpFormatter + PLUGIN_BASE, add_help=True, formatter_class=SortingHelpFormatter ) ) diff --git a/linodecli/plugins/metadata.py b/linodecli/plugins/metadata.py index f9805ef45..ad781797d 100644 --- a/linodecli/plugins/metadata.py +++ b/linodecli/plugins/metadata.py @@ -186,9 +186,7 @@ def get_metadata_parser(): Builds argparser for Metadata plug-in """ parser = ArgumentParser( - PLUGIN_BASE, - add_help=False, - formatter_class=SortingHelpFormatter + PLUGIN_BASE, add_help=False, formatter_class=SortingHelpFormatter ) register_debug_arg(parser) diff --git a/linodecli/plugins/obj/__init__.py b/linodecli/plugins/obj/__init__.py index 8295068e8..45c552db1 100644 --- a/linodecli/plugins/obj/__init__.py +++ b/linodecli/plugins/obj/__init__.py @@ -71,8 +71,8 @@ def generate_url(get_client, args, **kwargs): # pylint: disable=unused-argument """ parser = inherit_plugin_args( ArgumentParser( - PLUGIN_BASE + " signurl", - formatter_class=SortingHelpFormatter) + PLUGIN_BASE + " signurl", formatter_class=SortingHelpFormatter + ) ) parser.add_argument( @@ -126,8 +126,7 @@ def set_acl(get_client, args, **kwargs): # pylint: disable=unused-argument """ parser = inherit_plugin_args( ArgumentParser( - PLUGIN_BASE + " setacl", - formatter_class=SortingHelpFormatter + PLUGIN_BASE + " setacl", formatter_class=SortingHelpFormatter ) ) @@ -195,8 +194,7 @@ def show_usage(get_client, args, **kwargs): # pylint: disable=unused-argument """ parser = inherit_plugin_args( ArgumentParser( - PLUGIN_BASE + " du", - formatter_class=SortingHelpFormatter + PLUGIN_BASE + " du", formatter_class=SortingHelpFormatter ) ) @@ -307,9 +305,7 @@ def get_obj_args_parser(): """ parser = inherit_plugin_args( ArgumentParser( - PLUGIN_BASE, - add_help=False, - formatter_class=SortingHelpFormatter + PLUGIN_BASE, add_help=False, formatter_class=SortingHelpFormatter ) ) diff --git a/linodecli/plugins/obj/buckets.py b/linodecli/plugins/obj/buckets.py index 37ebc4d8c..97237e3ab 100644 --- a/linodecli/plugins/obj/buckets.py +++ b/linodecli/plugins/obj/buckets.py @@ -20,8 +20,7 @@ def create_bucket( """ parser = inherit_plugin_args( ArgumentParser( - PLUGIN_BASE + " mb", - formatter_class=SortingHelpFormatter + PLUGIN_BASE + " mb", formatter_class=SortingHelpFormatter ) ) @@ -49,8 +48,7 @@ def delete_bucket( """ parser = inherit_plugin_args( ArgumentParser( - PLUGIN_BASE + " rb", - formatter_class=SortingHelpFormatter + PLUGIN_BASE + " rb", formatter_class=SortingHelpFormatter ) ) diff --git a/linodecli/plugins/obj/list.py b/linodecli/plugins/obj/list.py index 89fce8152..1435d0924 100644 --- a/linodecli/plugins/obj/list.py +++ b/linodecli/plugins/obj/list.py @@ -34,8 +34,7 @@ def list_objects_or_buckets( """ parser = inherit_plugin_args( ArgumentParser( - PLUGIN_BASE + " ls", - formatter_class=SortingHelpFormatter + PLUGIN_BASE + " ls", formatter_class=SortingHelpFormatter ) ) @@ -139,8 +138,7 @@ def list_all_objects( # this is for printing help when --help is in the args parser = inherit_plugin_args( ArgumentParser( - PLUGIN_BASE + " la", - formatter_class=SortingHelpFormatter + PLUGIN_BASE + " la", formatter_class=SortingHelpFormatter ) ) diff --git a/linodecli/plugins/obj/objects.py b/linodecli/plugins/obj/objects.py index 6d4aa2bb7..56e189474 100644 --- a/linodecli/plugins/obj/objects.py +++ b/linodecli/plugins/obj/objects.py @@ -39,8 +39,7 @@ def upload_object( """ parser = inherit_plugin_args( ArgumentParser( - PLUGIN_BASE + " put", - formatter_class=SortingHelpFormatter + PLUGIN_BASE + " put", formatter_class=SortingHelpFormatter ) ) @@ -139,8 +138,7 @@ def get_object( """ parser = inherit_plugin_args( ArgumentParser( - PLUGIN_BASE + " get", - formatter_class=SortingHelpFormatter + PLUGIN_BASE + " get", formatter_class=SortingHelpFormatter ) ) @@ -220,8 +218,7 @@ def delete_object( """ parser = inherit_plugin_args( ArgumentParser( - PLUGIN_BASE + " del", - formatter_class=SortingHelpFormatter + PLUGIN_BASE + " del", formatter_class=SortingHelpFormatter ) ) diff --git a/linodecli/plugins/obj/website.py b/linodecli/plugins/obj/website.py index 54e600f92..838776750 100644 --- a/linodecli/plugins/obj/website.py +++ b/linodecli/plugins/obj/website.py @@ -17,8 +17,7 @@ def enable_static_site( """ parser = inherit_plugin_args( ArgumentParser( - PLUGIN_BASE + " ws-create", - formatter_class=SortingHelpFormatter + PLUGIN_BASE + " ws-create", formatter_class=SortingHelpFormatter ) ) @@ -82,8 +81,7 @@ def static_site_info( """ parser = inherit_plugin_args( ArgumentParser( - PLUGIN_BASE + " ws-info", - formatter_class=SortingHelpFormatter + PLUGIN_BASE + " ws-info", formatter_class=SortingHelpFormatter ) ) @@ -122,8 +120,7 @@ def disable_static_site( """ parser = inherit_plugin_args( ArgumentParser( - PLUGIN_BASE + " du", - formatter_class=SortingHelpFormatter + PLUGIN_BASE + " du", formatter_class=SortingHelpFormatter ) ) diff --git a/linodecli/plugins/ssh.py b/linodecli/plugins/ssh.py index 8e6084bf9..839745976 100644 --- a/linodecli/plugins/ssh.py +++ b/linodecli/plugins/ssh.py @@ -37,7 +37,7 @@ def call(args, context): # pylint: disable=too-many-branches argparse.ArgumentParser( "linode-cli ssh", add_help=True, - formatter_class=SortingHelpFormatter + formatter_class=SortingHelpFormatter, ) )