Skip to content

Commit

Permalink
Removed 'and exit' from option help text
Browse files Browse the repository at this point in the history
Details:

* Removed the text 'and exit' from the option help text of the following
  options:
  - --help
  - --version
  - --help-instancename

Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
  • Loading branch information
andy-maier committed Apr 8, 2020
1 parent 770ad34 commit 90c5721
Show file tree
Hide file tree
Showing 10 changed files with 108 additions and 59 deletions.
100 changes: 50 additions & 50 deletions docs/pywbemcli/cmdshelp.rst

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion pywbemtools/pywbemcli/_cmd_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from ._common_options import add_options, propertylist_option, \
names_only_option, include_classorigin_class_option, namespace_option, \
summary_option, multiple_namespaces_option, association_filter_option, \
indication_filter_option, experimental_filter_option
indication_filter_option, experimental_filter_option, help_option
from ._displaytree import display_class_tree
from ._click_extensions import PywbemcliGroup, PywbemcliCommand

Expand Down Expand Up @@ -80,6 +80,7 @@

@cli.group('class', cls=PywbemcliGroup, options_metavar=GENERAL_OPTS_TXT,
subcommand_metavar=SUBCMD_HELP_TXT)
@add_options(help_option)
def class_group():
"""
Command group for CIM classes.
Expand Down Expand Up @@ -109,6 +110,7 @@ def class_group():
@add_options(association_filter_option)
@add_options(indication_filter_option)
@add_options(experimental_filter_option)
@add_options(help_option)
@click.pass_obj
def class_enumerate(context, classname, **options):
"""
Expand Down Expand Up @@ -148,6 +150,7 @@ class (CLASSNAME argument) in the specified namespace. If no namespace was
@add_options(include_classorigin_class_option)
@add_options(propertylist_option)
@add_options(namespace_option)
@add_options(help_option)
@click.pass_obj
def class_get(context, classname, **options):
"""
Expand Down Expand Up @@ -180,6 +183,7 @@ def class_get(context, classname, **options):
'Some servers may still reject the class deletion. '
'Default: Reject command if the class has any instances.')
@add_options(namespace_option)
@add_options(help_option)
@click.pass_obj
def class_delete(context, classname, **options):
"""
Expand Down Expand Up @@ -218,6 +222,7 @@ def class_delete(context, classname, **options):
'May be specified multiple times. '
'Default: No input parameters.')
@add_options(namespace_option)
@add_options(help_option)
@click.pass_obj
def class_invokemethod(context, classname, methodname, **options):
"""
Expand Down Expand Up @@ -264,6 +269,7 @@ def class_invokemethod(context, classname, methodname, **options):
@add_options(names_only_option)
@add_options(namespace_option)
@add_options(summary_option)
@add_options(help_option)
@click.pass_obj
def class_references(context, classname, **options):
"""
Expand Down Expand Up @@ -317,6 +323,7 @@ def class_references(context, classname, **options):
@add_options(names_only_option)
@add_options(namespace_option)
@add_options(summary_option)
@add_options(help_option)
@click.pass_obj
def class_associators(context, classname, **options):
"""
Expand Down Expand Up @@ -356,6 +363,7 @@ def class_associators(context, classname, **options):
@add_options(association_filter_option)
@add_options(indication_filter_option)
@add_options(experimental_filter_option)
@add_options(help_option)
@click.pass_obj
def class_find(context, classname_glob, **options):
"""
Expand Down Expand Up @@ -396,6 +404,7 @@ class names case insensitively.
help='Show the superclass hierarchy. '
'Default: Show the subclass hierarchy.')
@add_options(namespace_option)
@add_options(help_option)
@click.pass_obj
def class_tree(context, classname, **options):
"""
Expand Down
9 changes: 9 additions & 0 deletions pywbemtools/pywbemcli/_cmd_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
from ._common import CMD_OPTS_TXT, GENERAL_OPTS_TXT, \
SUBCMD_HELP_TXT, pick_one_from_list, format_table, \
raise_pywbem_error_exception, validate_output_format
from ._common_options import add_options, help_option
from ._pywbem_server import PywbemServer
from ._connection_repository import ConnectionRepository
from ._context_obj import ContextObj
Expand All @@ -42,6 +43,7 @@

@cli.group('connection', cls=PywbemcliGroup, options_metavar=GENERAL_OPTS_TXT,
subcommand_metavar=SUBCMD_HELP_TXT)
@add_options(help_option)
def connection_group():
"""
Command group for WBEM connection definitions.
Expand All @@ -61,6 +63,7 @@ def connection_group():

@connection_group.command('export', cls=PywbemcliCommand,
options_metavar=CMD_OPTS_TXT)
@add_options(help_option)
@click.pass_obj
def connection_export(context):
"""
Expand All @@ -85,6 +88,7 @@ def connection_export(context):
default=False,
help='If set, show existing password in results. Otherwise, '
'password is masked')
@add_options(help_option)
@click.pass_obj
def connection_show(context, name, **options):
"""
Expand Down Expand Up @@ -125,6 +129,7 @@ def connection_show(context, name, **options):
@connection_group.command('delete', cls=PywbemcliCommand,
options_metavar=CMD_OPTS_TXT)
@click.argument('name', type=str, metavar='NAME', required=False)
@add_options(help_option)
@click.pass_obj
def connection_delete(context, name):
"""
Expand All @@ -149,6 +154,7 @@ def connection_delete(context, name):
help='If set, the connection is set to be the default connection '
' in the connections file in addition to setting it as the '
'current connection.')
@add_options(help_option)
@click.pass_obj
def connection_select(context, name, **options):
"""
Expand Down Expand Up @@ -192,6 +198,7 @@ def connection_select(context, name, **options):

@connection_group.command('test', cls=PywbemcliCommand,
options_metavar=CMD_OPTS_TXT)
@add_options(help_option)
@click.pass_obj
def connection_test(context):
"""
Expand All @@ -211,6 +218,7 @@ def connection_test(context):
@connection_group.command('save', cls=PywbemcliCommand,
options_metavar=CMD_OPTS_TXT)
@click.argument('name', type=str, metavar='NAME', required=True)
@add_options(help_option)
@click.pass_obj
def connection_save(context, name):
"""
Expand All @@ -237,6 +245,7 @@ def connection_save(context, name):
default=False,
help='If set, display the full table. Otherwise display '
'a brief view(name, server, mock_server columns).')
@add_options(help_option)
@click.pass_obj
def connection_list(context, **options):
"""
Expand Down
16 changes: 14 additions & 2 deletions pywbemtools/pywbemcli/_cmd_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
names_only_option, include_classorigin_instance_option, namespace_option, \
summary_option, verify_option, multiple_namespaces_option, \
association_filter_option, indication_filter_option, \
experimental_filter_option
experimental_filter_option, help_option

from ._cimvalueformatter import mof_escaped

Expand Down Expand Up @@ -151,7 +151,7 @@
click.option('--hi', '--help-instancename', 'help_instancename',
is_flag=True, required=False, is_eager=True,
help='Show help message for specifying INSTANCENAME including '
'use of the --key and --namespace options and exit.')]
'use of the --key and --namespace options.')]


##########################################################################
Expand All @@ -164,6 +164,7 @@

@cli.group('instance', cls=PywbemcliGroup, options_metavar=GENERAL_OPTS_TXT,
subcommand_metavar=SUBCMD_HELP_TXT)
@add_options(help_option)
def instance_group():
"""
Command group for CIM instances.
Expand Down Expand Up @@ -193,6 +194,7 @@ def instance_group():
@add_options(summary_option)
@add_options(filter_query_option)
@add_options(filter_query_language_option)
@add_options(help_option)
@click.pass_obj
def instance_enumerate(context, classname, **options):
"""
Expand Down Expand Up @@ -231,6 +233,7 @@ def instance_enumerate(context, classname, **options):
@add_options(keybinding_key_option)
@add_options(namespace_option)
@add_options(help_instancename_option)
@add_options(help_option)
@click.pass_obj
def instance_get(context, instancename, **options):
"""
Expand Down Expand Up @@ -261,6 +264,7 @@ def instance_get(context, instancename, **options):
@add_options(keybinding_key_option)
@add_options(namespace_option)
@add_options(help_instancename_option)
@add_options(help_option)
@click.pass_obj
def instance_delete(context, instancename, **options):
"""
Expand All @@ -283,6 +287,7 @@ def instance_delete(context, instancename, **options):
@add_options(property_create_option)
@add_options(verify_option)
@add_options(namespace_option)
@add_options(help_option)
@click.pass_obj
def instance_create(context, classname, **options):
"""
Expand Down Expand Up @@ -327,6 +332,7 @@ def instance_create(context, classname, **options):
@add_options(keybinding_key_option)
@add_options(namespace_option)
@add_options(help_instancename_option)
@add_options(help_option)
@click.pass_obj
def instance_modify(context, instancename, **options):
"""
Expand Down Expand Up @@ -383,6 +389,7 @@ def instance_modify(context, instancename, **options):
@add_options(filter_query_option)
@add_options(filter_query_language_option)
@add_options(help_instancename_option)
@add_options(help_option)
@click.pass_obj
def instance_associators(context, instancename, **options):
"""
Expand Down Expand Up @@ -435,6 +442,7 @@ def instance_associators(context, instancename, **options):
@add_options(filter_query_option)
@add_options(filter_query_language_option)
@add_options(help_instancename_option)
@add_options(help_option)
@click.pass_obj
def instance_references(context, instancename, **options):
"""
Expand Down Expand Up @@ -482,6 +490,7 @@ def instance_references(context, instancename, **options):
@add_options(keybinding_key_option)
@add_options(namespace_option)
@add_options(help_instancename_option)
@add_options(help_option)
@click.pass_obj
def instance_invokemethod(context, instancename, methodname, **options):
"""
Expand Down Expand Up @@ -529,6 +538,7 @@ def instance_invokemethod(context, instancename, methodname, **options):
format(default=DEFAULT_QUERY_LANGUAGE))
@add_options(namespace_option)
@add_options(summary_option)
@add_options(help_option)
@click.pass_obj
def instance_query(context, query, **options):
"""
Expand All @@ -554,6 +564,7 @@ def instance_query(context, query, **options):
@add_options(experimental_filter_option)
@click.option('-s', '--sort', is_flag=True, required=False,
help='Sort by instance count. Otherwise sorted by class name.')
@add_options(help_option)
@click.pass_obj
def instance_count(context, classname, **options):
"""
Expand Down Expand Up @@ -614,6 +625,7 @@ class names case insensitively.
'for all instances and the "CreationClassName" key. When'
'this option is used the full instance paths are displayed.')
@add_options(help_instancename_option)
@add_options(help_option)
@click.pass_obj
def instance_shrub(context, instancename, **options):
"""
Expand Down
6 changes: 5 additions & 1 deletion pywbemtools/pywbemcli/_cmd_qualifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@
from ._common import display_cim_objects, sort_cimobjects, \
raise_pywbem_error_exception, validate_output_format, \
CMD_OPTS_TXT, GENERAL_OPTS_TXT, SUBCMD_HELP_TXT
from ._common_options import add_options, namespace_option, summary_option
from ._common_options import add_options, namespace_option, summary_option, \
help_option
from ._click_extensions import PywbemcliGroup, PywbemcliCommand


@cli.group('qualifier', cls=PywbemcliGroup, options_metavar=GENERAL_OPTS_TXT,
subcommand_metavar=SUBCMD_HELP_TXT)
@add_options(help_option)
def qualifier_group():
"""
Command group for CIM qualifier declarations.
Expand All @@ -58,6 +60,7 @@ def qualifier_group():
@click.argument('qualifiername', type=str, metavar='QUALIFIERNAME',
required=True,)
@add_options(namespace_option)
@add_options(help_option)
@click.pass_obj
def qualifier_get(context, qualifiername, **options):
"""
Expand All @@ -78,6 +81,7 @@ def qualifier_get(context, qualifiername, **options):
options_metavar=CMD_OPTS_TXT)
@add_options(namespace_option)
@add_options(summary_option)
@add_options(help_option)
@click.pass_obj
def qualifier_enumerate(context, **options):
"""
Expand Down
8 changes: 8 additions & 0 deletions pywbemtools/pywbemcli/_cmd_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from .pywbemcli import cli
from ._common import format_table, raise_pywbem_error_exception, \
validate_output_format, CMD_OPTS_TXT, GENERAL_OPTS_TXT, SUBCMD_HELP_TXT
from ._common_options import add_options, help_option
from ._click_extensions import PywbemcliGroup, PywbemcliCommand

# NOTE: A number of the options use double-dash as the short form. In those
Expand All @@ -41,6 +42,7 @@

@cli.group('server', cls=PywbemcliGroup, options_metavar=GENERAL_OPTS_TXT,
subcommand_metavar=SUBCMD_HELP_TXT)
@add_options(help_option)
def server_group():
"""
Command group for WBEM servers.
Expand All @@ -58,6 +60,7 @@ def server_group():

@server_group.command('namespaces', cls=PywbemcliCommand,
options_metavar=CMD_OPTS_TXT)
@add_options(help_option)
@click.pass_obj
def server_namespaces(context, **options):
"""
Expand All @@ -69,6 +72,7 @@ def server_namespaces(context, **options):

@server_group.command('interop', cls=PywbemcliCommand,
options_metavar=CMD_OPTS_TXT)
@add_options(help_option)
@click.pass_obj
def server_interop(context):
"""
Expand All @@ -80,6 +84,7 @@ def server_interop(context):

@server_group.command('brand', cls=PywbemcliCommand,
options_metavar=CMD_OPTS_TXT)
@add_options(help_option)
@click.pass_obj
def server_brand(context):
"""
Expand All @@ -95,6 +100,7 @@ def server_brand(context):

@server_group.command('info', cls=PywbemcliCommand,
options_metavar=CMD_OPTS_TXT)
@add_options(help_option)
@click.pass_obj
def server_info(context):
"""
Expand All @@ -113,6 +119,7 @@ def server_info(context):
@click.option('-p', '--profile', type=str, metavar='PROFILE-NAME',
required=False,
help='Filter by the profile name. (ex. -p Array')
@add_options(help_option)
@click.pass_obj
def server_profiles(context, **options):
"""
Expand Down Expand Up @@ -158,6 +165,7 @@ def server_profiles(context, **options):
default='dmtf',
show_default=True,
help='Navigation direction for association.')
@add_options(help_option)
@click.pass_obj
def centralinsts(context, **options):
"""
Expand Down
3 changes: 3 additions & 0 deletions pywbemtools/pywbemcli/_common_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@
'experimental (--no-iexperimental). If the option is not '
'defined no filtering occurs')]

help_option = [ # pylint: disable=invalid-name
click.help_option('-h', '--help', help='Show this help message.')]


def add_options(options):
"""
Expand Down
Loading

0 comments on commit 90c5721

Please sign in to comment.