From patchwork Mon May 22 15:00:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1/4] Add long option for verbosity changes From: X-Patchwork-Id: 5223 Message-Id: <1495465217-25647-2-git-send-email-vkabatov@redhat.com> To: Date: Mon, 22 May 2017 17:00:14 +0200 From: Veronika Kabatova 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 --- 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"