Skip to content

Commit 570ffb4

Browse files
committed
DevconfigCmd: add support for matching line/section
Signed-off-by: Dinesh Dutt <[email protected]>
1 parent 51e4779 commit 570ffb4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

suzieq/cli/sqcmds/DevconfigCmd.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
from nubia import command
1+
from nubia import command, argument
22

33
from suzieq.cli.sqcmds.command import SqTableCommand
44
from suzieq.sqobjects.devconfig import DevconfigObj
55

66

77
@command("devconfig", help="Act on device data")
8+
@argument("section",
9+
description="show device config only for this regex match")
810
class DevconfigCmd(SqTableCommand):
911
"""Device configurations"""
1012

@@ -19,6 +21,7 @@ def __init__(
1921
format: str = "", # pylint: disable=redefined-builtin
2022
query_str: str = " ",
2123
columns: str = "default",
24+
section: str = '',
2225
) -> None:
2326
super().__init__(
2427
engine=engine,
@@ -33,10 +36,12 @@ def __init__(
3336
sqobj=DevconfigObj,
3437
)
3538

39+
self.lvars['section'] = section
40+
3641
@command("show", help="Show device information")
3742
def show(self):
3843
"""Show device config info
3944
"""
4045
if not self.format or (self.format == 'text'):
41-
self.format = 'devconfig'
46+
self.format = 'markdown'
4247
return super().show()

0 commit comments

Comments
 (0)