[1/4,v4] Add long option for verbosity changes

Submitted by Veronika Kabatova on June 16, 2017, 3:17 p.m.

Details

Message ID 1497626241-21695-2-git-send-email-vkabatov@redhat.com
State New
Series "Implementation of configuration files"
Headers show

Commit Message

Veronika Kabatova June 16, 2017, 3:17 p.m.
From: Veronika Kabatova <vkabatov@redhat.com>

Only long options are supported in configuration files. "-v" is the only
short option which doesn't have a corresponding long option, therefore
users wouldn't be able to setup verbosity in configuration files without
this patch.

Signed-off-by: Veronika Kabatova <vkabatov@redhat.com>
---
 Documentation/criu.txt | 7 ++++---
 criu/crtools.c         | 5 +++--
 2 files changed, 7 insertions(+), 5 deletions(-)

Patch hide | download patch | download mbox

diff --git a/Documentation/criu.txt b/Documentation/criu.txt
index 6758e9b..dfd6ebc 100644
--- a/Documentation/criu.txt
+++ b/Documentation/criu.txt
@@ -32,11 +32,12 @@  Common options
 ~~~~~~~~~~~~~~
 Common options are applicable to any 'command'.
 
-*-v*[*v*...]::
+*-v*[*v*...], *--verbosity*::
     Increase verbosity up from the default level. Multiple *v* can be used,
-    each increasing verbosity by one level.
+    each increasing verbosity by one level. Using long option without argument
+    increases verbosity by one level.
 
-*-v*'num'::
+*-v*'num', *--verbosity*='num'::
     Set verbosity level to 'num'. The higher the level, the more output
     is produced.
     +
diff --git a/criu/crtools.c b/criu/crtools.c
index bba52b1..f8c97a3 100644
--- a/criu/crtools.c
+++ b/criu/crtools.c
@@ -312,6 +312,7 @@  int main(int argc, char *argv[], char *envp[])
 		BOOL_OPT("weak-sysctls", &opts.weak_sysctls),
 		{ "status-fd",			required_argument,	0, 1088 },
 		BOOL_OPT("remote", &opts.remote),
+		{ "verbosity",			optional_argument,	0, 'v'	},
 		{ },
 	};
 
@@ -961,8 +962,8 @@  usage:
 "* Logging:\n"
 "  -o|--log-file FILE    log file name\n"
 "     --log-pid          enable per-process logging to separate FILE.pid files\n"
-"  -v[v...]            increase verbosity (can use multiple v)\n"
-"  -vNUM               set verbosity to NUM (higher level means more output):\n"
+"  -v[v...]|--verbosity  increase verbosity (can use multiple v)\n"
+"  -vNUM|--verbosity=NUM set verbosity to NUM (higher level means more output):\n"
 "                          -v1 - only errors and messages\n"
 "                          -v2 - also warnings (default level)\n"
 "                          -v3 - also information messages and timestamps\n"