From 47d8d444a7c8170e4c903003a0476f829cce8984 Mon Sep 17 00:00:00 2001 From: Arvin Schnell Date: Mon, 26 Feb 2024 11:38:59 +0100 Subject: [PATCH] - use table for printing command line options help --- client/GlobalOptions.cc | 44 ++++++++++++++++++---------------- client/GlobalOptions.h | 2 +- client/cmd-cleanup.cc | 11 +++++---- client/cmd-create-config.cc | 11 +++++---- client/cmd-create.cc | 27 +++++++++++---------- client/cmd-delete.cc | 9 ++++--- client/cmd-diff.cc | 13 ++++++---- client/cmd-get-config.cc | 11 +++++---- client/cmd-list-configs.cc | 10 ++++---- client/cmd-list.cc | 18 +++++++------- client/cmd-modify.cc | 19 ++++++++------- client/cmd-rollback.cc | 15 +++++++----- client/cmd-status.cc | 9 ++++--- client/cmd-undochange.cc | 9 ++++--- client/snapper.cc | 2 +- client/utils/Makefile.am | 26 ++++++++++---------- client/utils/help.cc | 48 +++++++++++++++++++++++++++++++++++++ client/utils/help.h | 43 +++++++++++++++++++++++++++++++++ 18 files changed, 226 insertions(+), 101 deletions(-) create mode 100644 client/utils/help.cc create mode 100644 client/utils/help.h diff --git a/client/GlobalOptions.cc b/client/GlobalOptions.cc index 9c8d5e00..0aa42f16 100644 --- a/client/GlobalOptions.cc +++ b/client/GlobalOptions.cc @@ -21,6 +21,7 @@ #include +#include "utils/help.h" #include "misc.h" #include "client/GlobalOptions.h" #include "client/utils/text.h" @@ -34,27 +35,30 @@ namespace snapper using namespace std; - string - GlobalOptions::help_text() + void + GlobalOptions::help_global_options() { - return string(_(" Global options:")) + '\n' - + _("\t--quiet, -q\t\t\tSuppress normal output.") + '\n' - + _("\t--verbose, -v\t\t\tIncrease verbosity.") + '\n' - + _("\t--debug\t\t\t\tTurn on debugging.") + '\n' - + _("\t--utc\t\t\t\tDisplay dates and times in UTC.") + '\n' - + _("\t--iso\t\t\t\tDisplay dates and times in ISO format.") + '\n' - + _("\t--table-style, -t