]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
ipcs: add --bytes size output option
authorSami Kerola <kerolasa@iki.fi>
Sun, 16 Dec 2012 10:43:52 +0000 (10:43 +0000)
committerKarel Zak <kzak@redhat.com>
Wed, 19 Dec 2012 10:05:00 +0000 (11:05 +0100)
This makes the command being a little closer standard compliant.  See
IEEE Std 1003.1 referral link below for more information.

References: http://pubs.opengroup.org/onlinepubs/009696799/utilities/ipcs.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
sys-utils/ipcs.1
sys-utils/ipcs.c

index 0a617d6f661f50d5316b2027d356b833c97ecc22..5fc3a8171201d60cbfb86080f41e95ea4c43ee11 100644 (file)
@@ -68,6 +68,9 @@ Show status summary.
 .TP
 .B \-\-human
 Print sizes in human readable format.
+.TP
+\fB\-b\fR, \fB\-\-bytes\fR
+Print sizes in bytes.
 .SH SEE ALSO
 .BR ipcrm (1),
 .BR ipcmk (1),
index 66c6302e398ffa9fefa63dd02723d61ddce36791..d611354c74a702c11cd7b1e38f2d17a6cfc6adb6 100644 (file)
@@ -67,6 +67,7 @@ static void __attribute__ ((__noreturn__)) usage(FILE * out)
        fputs(_(" -l, --limits      show resource limits\n"), out);
        fputs(_(" -u, --summary     show status summary\n"), out);
        fputs(_("     --human       show sizes in human readable format\n"), out);
+       fputs(_(" -b, --bytes       show sizes in bytes\n"), out);
        fprintf(out, USAGE_MAN_TAIL("ipcs(1)"));
        exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
 }
@@ -88,11 +89,12 @@ int main (int argc, char **argv)
                {"limits", no_argument, NULL, 'l'},
                {"summary", no_argument, NULL, 'u'},
                {"human", no_argument, NULL, OPT_HUMAN},
+               {"bytes", no_argument, NULL, 'b'},
                {"version", no_argument, NULL, 'V'},
                {"help", no_argument, NULL, 'h'},
                {NULL, 0, NULL, 0}
        };
-       char options[] = "i:mqsatpcluVh";
+       char options[] = "i:mqsatpclubVh";
 
        setlocale(LC_ALL, "");
        bindtextdomain(PACKAGE, LOCALEDIR);
@@ -135,6 +137,9 @@ int main (int argc, char **argv)
                case OPT_HUMAN:
                        unit = IPC_UNIT_HUMAN;
                        break;
+               case 'b':
+                       unit = IPC_UNIT_BYTES;
+                       break;
                case 'h':
                        usage(stdout);
                case 'V':