From 69043c4eced8f61ec142cf048b6a4abd1be3bbe2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Tue, 16 Mar 2021 08:41:43 +0100
Subject: [PATCH] Do not specify options multiple times
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Getopt::Long::Descriptive 0.106 started to warn about duplicate
options.
<https://github.com/dod38fr/cme-perl/issues/5>
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
lib/App/Cme/Command/check.pm | 3 ++-
lib/App/Cme/Command/dump.pm | 3 +++
lib/App/Cme/Command/edit.pm | 1 +
lib/App/Cme/Command/fix.pm | 1 +
lib/App/Cme/Command/fusefs.pm | 1 +
lib/App/Cme/Command/migrate.pm | 1 +
lib/App/Cme/Command/search.pm | 3 +++
lib/App/Cme/Command/shell.pm | 1 +
lib/App/Cme/Command/update.pm | 1 +
lib/App/Cme/Common.pm | 1 -
10 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/lib/App/Cme/Command/check.pm b/lib/App/Cme/Command/check.pm
index 9c0f6e1..7d62ffe 100644
--- a/lib/App/Cme/Command/check.pm
+++ b/lib/App/Cme/Command/check.pm
@@ -22,7 +22,8 @@ sub validate_args {
sub opt_spec {
my ( $class, $app ) = @_;
return (
- [ "strict!" => "cme will exit 1 if warnings are found during check" ],
+ [ "strict!" => "cme will exit 1 if warnings are found during check" ],
+ [ "verbose!" => "Show what's going on"],
$class->cme_global_options,
);
}
diff --git a/lib/App/Cme/Command/dump.pm b/lib/App/Cme/Command/dump.pm
index 61c6b39..6b87d13 100644
--- a/lib/App/Cme/Command/dump.pm
+++ b/lib/App/Cme/Command/dump.pm
@@ -39,6 +39,9 @@ sub opt_spec {
default => 'yaml'
},
],
+ [
+ "verbose!" => "Show what's going on"
+ ],
$class->cme_global_options,
);
}
diff --git a/lib/App/Cme/Command/edit.pm b/lib/App/Cme/Command/edit.pm
index af518be..d727760 100644
--- a/lib/App/Cme/Command/edit.pm
+++ b/lib/App/Cme/Command/edit.pm
@@ -24,6 +24,7 @@ sub opt_spec {
[ "ui|if=s" => "user interface type. Either tk, curses, shell" ],
[ "backup:s" => "Create a backup of configuration files before saving." ],
[ "open-item=s" => "open a specific item of the configuration" ],
+ [ "verbose!" => "Show what's going on" ],
$class->cme_global_options,
);
}
diff --git a/lib/App/Cme/Command/fix.pm b/lib/App/Cme/Command/fix.pm
index d3af73e..bfc39a2 100644
--- a/lib/App/Cme/Command/fix.pm
+++ b/lib/App/Cme/Command/fix.pm
@@ -24,6 +24,7 @@ sub opt_spec {
[ "from=s@" => "fix only a subset of a configuration tree" ],
[ "backup:s" => "Create a backup of configuration files before saving." ],
[ "filter=s" => "pattern to select the element name to be fixed"],
+ [ "verbose!" => "Show what's going on" ],
$class->cme_global_options,
);
}
diff --git a/lib/App/Cme/Command/fusefs.pm b/lib/App/Cme/Command/fusefs.pm
index 58cf493..1c7da39 100644
--- a/lib/App/Cme/Command/fusefs.pm
+++ b/lib/App/Cme/Command/fusefs.pm
@@ -38,6 +38,7 @@ sub opt_spec {
[ "dfuse!" => "debug fuse problems" ],
[ "dir-char=s" => "string to replace '/' in configuration parameter names"],
[ "backup:s" => "Create a backup of configuration files before saving." ],
+ [ "verbose!" => "Show what's going on" ],
$class->cme_global_options,
);
}
diff --git a/lib/App/Cme/Command/migrate.pm b/lib/App/Cme/Command/migrate.pm
index 86a9fca..601bbda 100644
--- a/lib/App/Cme/Command/migrate.pm
+++ b/lib/App/Cme/Command/migrate.pm
@@ -22,6 +22,7 @@ sub opt_spec {
my ( $class, $app ) = @_;
return (
[ "backup:s" => "Create a backup of configuration files before saving." ],
+ [ "verbose!" => "Show what's going on" ],
$class->cme_global_options,
);
}
diff --git a/lib/App/Cme/Command/search.pm b/lib/App/Cme/Command/search.pm
index 5d90c95..d264221 100644
--- a/lib/App/Cme/Command/search.pm
+++ b/lib/App/Cme/Command/search.pm
@@ -29,6 +29,9 @@ sub opt_spec {
"narrow-search=s" => "narrows down the search to element, value, key, summary, description or help",
{ regex => qr/^(?:element|value|key|summary|description|help|all)$/, default => 'all' }
],
+ [
+ "verbose!" => "Show what's going on"
+ ],
$class->cme_global_options,
);
}
diff --git a/lib/App/Cme/Command/shell.pm b/lib/App/Cme/Command/shell.pm
index 4b702c6..d1e2f1b 100644
--- a/lib/App/Cme/Command/shell.pm
+++ b/lib/App/Cme/Command/shell.pm
@@ -22,6 +22,7 @@ sub opt_spec {
[ "open-item=s" => "open a specific item of the configuration" ],
[ "backup:s" => "Create a backup of configuration files before saving." ],
[ "bare!" => "run bare terminal UI"],
+ [ "verbose!" => "Show what's going on" ],
$class->cme_global_options,
);
}
diff --git a/lib/App/Cme/Command/update.pm b/lib/App/Cme/Command/update.pm
index af53e80..baa2f8d 100644
--- a/lib/App/Cme/Command/update.pm
+++ b/lib/App/Cme/Command/update.pm
@@ -25,6 +25,7 @@ sub opt_spec {
return (
[ "edit!" => "Run editor after update is done" ],
[ "backup:s" => "Create a backup of configuration files before saving." ],
+ [ "verbose!" => "Show what's going on" ],
$class->cme_global_options,
);
}
diff --git a/lib/App/Cme/Common.pm b/lib/App/Cme/Common.pm
index d4f1e71..18b5c60 100644
--- a/lib/App/Cme/Common.pm
+++ b/lib/App/Cme/Common.pm
@@ -33,7 +33,6 @@ sub cme_global_options {
# to be deprecated
[ "canonical!" => "write back config data according to canonical order" ],
[ "trace|stack-trace!" => "Provides a full stack trace when exiting on error"],
- [ "verbose!" => "Show what's going on"],
[ "quiet" => "Suppress all output except error messages"],
# no bundling
{ getopt_conf => [ qw/no_bundling/ ] }
--
2.26.3