cli: add 'show operational [path /X]' and path filter to config views

Extend the existing 'show <running|startup|factory>-config' family with an
optional 'path /XPATH' argument that maps straight to the underlying 'copy
-x' flag, and add 'show operational [path /XPATH]' for symmetry with the
configuration datastores.

  admin@example:/> show running-config path /ietf-interfaces:interfaces
  admin@example:/> show operational path /ietf-system:system-state

Also, improve error feedback from the copy command slightly.

Before:
  admin@example:~$ copy running -x /foo
  Error: (null) (5)
  Error: failed retrieving running-config data

After:
  admin@example:~$ copy running -x /foo
  Error: Couldn't parse path "/foo": Prefix "foo" not defined. (5)
  Error: failed retrieving running-config data

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2026-05-27 20:53:31 +02:00
parent 6958c9bb1a
commit 925a43dead
4 changed files with 45 additions and 14 deletions
+2
View File
@@ -38,6 +38,8 @@ All notable changes to the project are documented in this file.
exposing the set of PMD types currently supported. Useful for SFP/SFP+
diagnosis: an LR-only optic narrows the list to a single entry, confirming
the transceiver without `ethtool -m`
- New CLI command `show operational`, and XPath filtering for this and any of
the other datastores, using `[path /path/to/subtree]`
### Fixes