[CRIU] [PATCH 1/4] Add long option for verbosity changes

vkabatov at redhat.com vkabatov at redhat.com
Mon May 22 08:00:14 PDT 2017


From: Veronika Kabatova <vkabatov at 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 at redhat.com>
---
 Documentation/criu.txt | 7 ++++---
 criu/crtools.c         | 5 +++--
 2 files changed, 7 insertions(+), 5 deletions(-)

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 b20d2ec..ab8e1b5 100644
--- a/criu/crtools.c
+++ b/criu/crtools.c
@@ -294,6 +294,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'	},
 		{ },
 	};
 
@@ -925,8 +926,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"
-- 
2.7.4



More information about the CRIU mailing list