Skip to content

Commit 0e3fa02

Browse files
committed
fix(cli): config examples
Signed-off-by: Chris Snow <[email protected]>
1 parent 7ab1b28 commit 0e3fa02

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

hpecp/cli/config.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import jmespath
2727
import sys
2828
import yaml
29+
from textwrap import dedent
2930

3031
from hpecp.cli import base
3132
from hpecp.cli_utils import TextOutput
@@ -36,9 +37,7 @@ class ConfigProxy(object):
3637

3738
def __dir__(self):
3839
"""Return the CLI method names."""
39-
return [
40-
"get",
41-
]
40+
return ["examples", "get"]
4241

4342
@base.intercept_exception
4443
def get(self, output="yaml", query=None):
@@ -86,3 +85,20 @@ def get(self, output="yaml", query=None):
8685
print(TextOutput.dump(data))
8786
else:
8887
print(json.dumps(data))
88+
89+
def examples(self):
90+
"""Show examples for working with roles."""
91+
print(
92+
dedent(
93+
"""\
94+
95+
$ hpecp config get --query 'objects.[bds_global_version]' --output text
96+
5.1.1
97+
98+
$ hpecp config get --query 'objects.[bds_global_version, bds_global_buildnumber]' --output text
99+
5.1.1
100+
2347
101+
102+
""" # noqa: E501
103+
)
104+
)

0 commit comments

Comments
 (0)