Blob Blame History Raw
From 99c7f643bab33a26c317e1b72ca3b8490cb1ea60 Mon Sep 17 00:00:00 2001
From: Fernando Fernandez Mancera <ffmancera@riseup.net>
Date: Fri, 16 Jul 2021 08:57:27 +0200
Subject: [PATCH 1/2] nmstatectl: fix long arguments support

The support for long arguments is broken. This patch is fixing it and
solving the following errors:

```
[root@d0b4a6a0f7a5 nmstate-workspace]# nmstatectl show --running-config
usage: nmstatectl [-h] [--version]
                  {commit,edit,rollback,set,apply,show,version,gc} ...
nmstatectl: error: unrecognized arguments: --running-config
[root@d0b4a6a0f7a5 nmstate-workspace]# nmstatectl show --show-secrets
usage: nmstatectl [-h] [--version]
                  {commit,edit,rollback,set,apply,show,version,gc} ...
nmstatectl: error: unrecognized arguments: --show-secrets
```

Integration test case added.

Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
Signed-off-by: Gris Ge <fge@redhat.com>
---
 nmstatectl/nmstatectl.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/nmstatectl/nmstatectl.py b/nmstatectl/nmstatectl.py
index a9f4cb6..6f83069 100644
--- a/nmstatectl/nmstatectl.py
+++ b/nmstatectl/nmstatectl.py
@@ -223,14 +223,16 @@ def setup_subcommand_show(subparsers):
         dest="yaml",
     )
     parser_show.add_argument(
-        "-r, --running-config",
+        "-r",
+        "--running-config",
         help="Show running configurations",
         default=False,
         action="store_true",
         dest="running_config",
     )
     parser_show.add_argument(
-        "-s, --show-secrets",
+        "-s",
+        "--show-secrets",
         help="Show secrets also",
         default=False,
         action="store_true",
-- 
2.32.0