]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemd-mount: add --no-legend command line option 14525/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 9 Jan 2020 05:49:11 +0000 (14:49 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 9 Jan 2020 11:16:03 +0000 (20:16 +0900)
man/systemd-mount.xml
src/mount/mount-tool.c

index 4a7c33f5584244261e9de09cc7f9fe25ab09849e..82ac61a447fffdfcf39fc959fad2368558dbb7d0 100644 (file)
@@ -96,6 +96,7 @@
       </varlistentry>
 
       <xi:include href="standard-options.xml" xpointer="no-pager"/>
+      <xi:include href="standard-options.xml" xpointer="no-legend" />
       <xi:include href="standard-options.xml" xpointer="no-ask-password"/>
 
       <varlistentry>
index 409141287882d08b9e09ffa58950c0ffdf2f2e02..69f140fb3e0f405c75be9679b5579c5ea94b0f42 100644 (file)
@@ -45,6 +45,7 @@ enum {
 
 static bool arg_no_block = false;
 static PagerFlags arg_pager_flags = 0;
+static bool arg_legend = true;
 static bool arg_ask_password = true;
 static bool arg_quiet = false;
 static BusTransport arg_transport = BUS_TRANSPORT_LOCAL;
@@ -90,6 +91,7 @@ static int help(void) {
                "     --version                    Show package version\n"
                "     --no-block                   Do not wait until operation finished\n"
                "     --no-pager                   Do not pipe output into a pager\n"
+               "     --no-legend                  Do not show the headers\n"
                "     --no-ask-password            Do not prompt for password\n"
                "  -q --quiet                      Suppress information messages during runtime\n"
                "     --user                       Run as user unit\n"
@@ -125,6 +127,7 @@ static int parse_argv(int argc, char *argv[]) {
                 ARG_VERSION = 0x100,
                 ARG_NO_BLOCK,
                 ARG_NO_PAGER,
+                ARG_NO_LEGEND,
                 ARG_NO_ASK_PASSWORD,
                 ARG_USER,
                 ARG_SYSTEM,
@@ -146,6 +149,7 @@ static int parse_argv(int argc, char *argv[]) {
                 { "version",            no_argument,       NULL, ARG_VERSION            },
                 { "no-block",           no_argument,       NULL, ARG_NO_BLOCK           },
                 { "no-pager",           no_argument,       NULL, ARG_NO_PAGER           },
+                { "no-legend",          no_argument,       NULL, ARG_NO_LEGEND          },
                 { "no-ask-password",    no_argument,       NULL, ARG_NO_ASK_PASSWORD    },
                 { "quiet",              no_argument,       NULL, 'q'                    },
                 { "user",               no_argument,       NULL, ARG_USER               },
@@ -196,6 +200,10 @@ static int parse_argv(int argc, char *argv[]) {
                         arg_pager_flags |= PAGER_DISABLE;
                         break;
 
+                case ARG_NO_LEGEND:
+                        arg_legend = false;
+                        break;
+
                 case ARG_NO_ASK_PASSWORD:
                         arg_ask_password = false;
                         break;
@@ -1389,6 +1397,8 @@ static int list_devices(void) {
         if (r < 0)
                 return log_error_errno(r, "Failed to set sort index: %m");
 
+        table_set_header(table, arg_legend);
+
         FOREACH_DEVICE(e, d) {
                 for (c = 0; c < _COLUMN_MAX; c++) {
                         const char *x = NULL;