Skip to content

Commit

Permalink
Merge c4c147d into 0a0deba
Browse files Browse the repository at this point in the history
  • Loading branch information
andy-maier committed Apr 2, 2020
2 parents 0a0deba + c4c147d commit 9605c87
Show file tree
Hide file tree
Showing 15 changed files with 1,054 additions and 493 deletions.
3 changes: 3 additions & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ Released: not yet

* Fixed issues in README and README_PYPI file (See issue #555)

* Improvements and bug fixes in the way the INSTANCENAME parameter of pywbemcli
commands is processed. (See issue #528)

**Enhancements:**

* Promoted development status of pywbemtools from Alpha to Beta.
Expand Down
198 changes: 78 additions & 120 deletions docs/pywbemcli/cmdshelp.rst

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions pywbemtools/pywbemcli/_cimvalueformatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def _scalar_value_tomof(value, type, indent, maxline, line_pos=0, end_space=0,
return _mofval(val, indent, maxline, line_pos, end_space)


def _mof_escaped(strvalue):
def mof_escaped(strvalue):
# Note: This is a raw docstring because it shows many backslashes, and
# that avoids having to double them.
r"""
Expand Down Expand Up @@ -319,7 +319,7 @@ def _mofstr(value, indent, maxline, line_pos, end_space, avoid_splits=False,
reference or datetime typed value).
The function performs the backslash-escaping of characters in the string
(for details, see function _mof_escaped()), handles the splitting into
(for details, see function mof_escaped()), handles the splitting into
multiple string parts if the current line does not have sufficient space
left, and surrounds the string parts (or the entire string, if it ends up
having only one part) with the specified quote characters.
Expand Down Expand Up @@ -372,7 +372,7 @@ def _mofstr(value, indent, maxline, line_pos, end_space, avoid_splits=False,

assert isinstance(value, six.text_type)

value = _mof_escaped(value)
value = mof_escaped(value)

quote_len = 2 # length of the quotes surrounding a string part
new_line = u'\n' + _indent_str(indent)
Expand Down
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

Expand Down Expand Up @@ -79,6 +79,7 @@
###########################################################################

@cli.group('class', cls=PywbemcliGroup, options_metavar=CMD_OPTS_TXT)
@add_options(help_option)
def class_group():
"""
Command group for CIM classes.
Expand Down Expand Up @@ -107,6 +108,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 @@ -146,6 +148,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 @@ -177,6 +180,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 @@ -214,6 +218,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 @@ -259,6 +264,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 @@ -311,6 +317,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 @@ -350,6 +357,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 @@ -390,6 +398,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 @@ -33,13 +33,15 @@
from .pywbemcli import cli
from ._common import CMD_OPTS_TXT, pick_one_from_list, format_table, \
hide_empty_columns, 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
from ._click_extensions import PywbemcliGroup


@cli.group('connection', cls=PywbemcliGroup, options_metavar=CMD_OPTS_TXT)
@add_options(help_option)
def connection_group():
"""
Command group for WBEM connection definitions.
Expand All @@ -58,6 +60,7 @@ def connection_group():


@connection_group.command('export', options_metavar=CMD_OPTS_TXT)
@add_options(help_option)
@click.pass_obj
def connection_export(context):
"""
Expand All @@ -81,6 +84,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 @@ -120,6 +124,7 @@ def connection_show(context, name, **options):

@connection_group.command('delete', 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 @@ -143,6 +148,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 @@ -185,6 +191,7 @@ def connection_select(context, name, **options):


@connection_group.command('test', options_metavar=CMD_OPTS_TXT)
@add_options(help_option)
@click.pass_obj
def connection_test(context):
"""
Expand All @@ -203,6 +210,7 @@ def connection_test(context):

@connection_group.command('save', 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 @@ -224,6 +232,7 @@ def connection_save(context, name):


@connection_group.command('list', options_metavar=CMD_OPTS_TXT)
@add_options(help_option)
@click.pass_obj
def connection_list(context):
"""
Expand Down

0 comments on commit 9605c87

Please sign in to comment.