* [PATCH 01/10] docs: improve some wordings on the man page of wipefs
@ 2014-12-24 16:56 Benno Schulenberg
2014-12-24 16:56 ` [PATCH 02/10] ipcs: in usage show resource option as nonoptional when used with -i Benno Schulenberg
` (8 more replies)
0 siblings, 9 replies; 13+ messages in thread
From: Benno Schulenberg @ 2014-12-24 16:56 UTC (permalink / raw)
To: util-linux
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
---
misc-utils/wipefs.8 | 33 +++++++++++++++++----------------
1 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/misc-utils/wipefs.8 b/misc-utils/wipefs.8
index 13cadb4..c4addef 100644
--- a/misc-utils/wipefs.8
+++ b/misc-utils/wipefs.8
@@ -2,7 +2,7 @@
.\" Copyright 2009 by Karel Zak. All Rights Reserved.
.\" This file may be copied under the terms of the GNU Public License.
.\"
-.TH WIPEFS 8 "October 2009" "util-linux" "System Administration"
+.TH WIPEFS 8 "December 2014" "util-linux" "System Administration"
.SH NAME
wipefs \- wipe a signature from a device
.SH SYNOPSIS
@@ -20,41 +20,42 @@ to make the signatures invisible for libblkid.
.B wipefs
does not erase the filesystem itself nor any other data from the device.
-When used without options \fB-a\fR or \fB-o\fR, it lists all visible filesystems
+When used without any options, \fBwipefs\fR lists all visible filesystems
and the offsets of their basic signatures.
.B wipefs
-calls BLKRRPART ioctl when erase partition table to inform kernel about the change.
+calls the BLKRRPART ioctl when it has erased a partition-table signature
+to inform the kernel about the change.
-Note that some filesystems or some partition tables store more magic strings on
-the devices. The
+Note that some filesystems and some partition tables store more magic strings on
+the device. The
.B wipefs
command lists only the first offset where a magic string has been detected. The device
is not scanned for additional magic strings for the same filesystem. It is possible
-that after \fBwipefs -o \fIoffset\fR the same filesystem or partition
-table will still be visible by another magic string on another offset.
+that after a \fBwipefs -o \fIoffset\fR the same filesystem or partition
+table will still be visible because of another magic string on another offset.
-When used with option \fB-a\fR, all magic strings that are visible for libblkid are
+When option \fB-a\fR is used, all magic strings that are visible for libblkid are
erased.
Note that by default
.B wipefs
-does not erase nested partition tables on non-whole disk devices. The option
-\-\-force is required.
+does not erase nested partition tables on non-whole disk devices.
+For this the option \fB\-\-force\fR is required.
.SH OPTIONS
.TP
.BR \-a , " \-\-all"
Erase all available signatures. The set of erased signatures can be
-restricted with the \fB\-t\fP \fIlist\fP option.
+restricted with the \fB\-t\fR option.
.TP
.BR \-b , " \-\-backup"
Create a signature backup to the file $HOME/wipefs-<devname>-<offset>.bak.
-For more details see EXAMPLES section.
+For more details see the \fBEXAMPLES\fR section.
.TP
.BR \-f , " \-\-force"
Force erasure, even if the filesystem is mounted. This is required in
-order to erase the partition table on a block device.
+order to erase a partition-table signature on a block device.
.TP
.BR \-h , " \-\-help"
Display help text and exit.
@@ -66,7 +67,7 @@ Causes everything to be done except for the write() call.
Specify the location (in bytes) of the signature which should be erased from the
device. The \fIoffset\fR number may include a "0x" prefix; then the number will be
interpreted as a hex value. It is possible to specify multiple \fB-o\fR options.
-
+.sp
The \fIoffset\fR argument may be followed by the multiplicative
suffixes KiB (=1024), MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB
(the "iB" is optional, e.g. "K" has the same meaning as "KiB"), or the suffixes
@@ -77,7 +78,7 @@ Print out in parsable instead of printable format. Encode all potentially unsaf
characters of a string to the corresponding hex value prefixed by '\\x'.
.TP
.BR \-q , " \-\-quiet"
-Suppress output messages after successful signature wipe.
+Suppress any messages after a successful signature wipe.
.TP
.BR \-t , " \-\-types " \fIlist\fP
Limit the set of printed or erased signatures. More than one type may
@@ -94,7 +95,7 @@ Erases all signatures from the device /dev/sdb and creates a signature backup
file ~/wipefs-sdb-<offset>.bak for each signature.
.TP
.BR "dd if=~/wipefs-sdb-0x00000438.bak of=/dev/sdb seek=$((0x00000438)) bs=1 conv=notrunc"
-Restores ext2 signature from the backup file ~/wipefs-sdb-0x00000438.bak.
+Restores an ext2 signature from the backup file ~/wipefs-sdb-0x00000438.bak.
.SH AUTHOR
Karel Zak <kzak@redhat.com>
.SH ENVIRONMENT
--
1.7.0.4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 02/10] ipcs: in usage show resource option as nonoptional when used with -i
2014-12-24 16:56 [PATCH 01/10] docs: improve some wordings on the man page of wipefs Benno Schulenberg
@ 2014-12-24 16:56 ` Benno Schulenberg
2014-12-29 10:09 ` Benno Schulenberg
2014-12-24 16:56 ` [PATCH 03/10] ipcrm: gettextize the command synopsis of the usage text Benno Schulenberg
` (7 subsequent siblings)
8 siblings, 1 reply; 13+ messages in thread
From: Benno Schulenberg @ 2014-12-24 16:56 UTC (permalink / raw)
To: util-linux
Also, the resource option -a is not valid with -i, so show the valid
ones explicitly. Also gettextize the synopsis as a single string, as
the two lines are tightly related and other synopses do this too.
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
---
sys-utils/ipcs.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/sys-utils/ipcs.c b/sys-utils/ipcs.c
index 9ce5366..440a39e 100644
--- a/sys-utils/ipcs.c
+++ b/sys-utils/ipcs.c
@@ -50,8 +50,8 @@ static void print_msg (int id, int unit);
static void __attribute__ ((__noreturn__)) usage(FILE * out)
{
fprintf(out, USAGE_HEADER);
- fprintf(out, " %s [resource ...] [output-format]\n", program_invocation_short_name);
- fprintf(out, " %s [resource] -i <id>\n", program_invocation_short_name);
+ fprintf(out, _(" %1$s [resource-option...] [output-option]\n"
+ " %1$s -m|-q|-s -i <id>\n"), program_invocation_short_name);
fprintf(out, USAGE_OPTIONS);
fputs(_(" -i, --id <id> print details on resource identified by <id>\n"), out);
fprintf(out, USAGE_HELP);
@@ -63,7 +63,7 @@ static void __attribute__ ((__noreturn__)) usage(FILE * out)
fputs(_(" -s, --semaphores semaphores\n"), out);
fputs(_(" -a, --all all (default)\n"), out);
fprintf(out, USAGE_SEPARATOR);
- fputs(_("Output format:\n"), out);
+ fputs(_("Output options:\n"), out);
fputs(_(" -t, --time show attach, detach and change times\n"), out);
fputs(_(" -p, --pid show PIDs of creator and last operator\n"), out);
fputs(_(" -c, --creator show creator and owner\n"), out);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 03/10] ipcrm: gettextize the command synopsis of the usage text
2014-12-24 16:56 [PATCH 01/10] docs: improve some wordings on the man page of wipefs Benno Schulenberg
2014-12-24 16:56 ` [PATCH 02/10] ipcs: in usage show resource option as nonoptional when used with -i Benno Schulenberg
@ 2014-12-24 16:56 ` Benno Schulenberg
2015-01-06 10:58 ` Karel Zak
2014-12-24 16:56 ` [PATCH 04/10] docs: restore the alternative form of setarch in its man page Benno Schulenberg
` (6 subsequent siblings)
8 siblings, 1 reply; 13+ messages in thread
From: Benno Schulenberg @ 2014-12-24 16:56 UTC (permalink / raw)
To: util-linux
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
---
sys-utils/ipcrm.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sys-utils/ipcrm.c b/sys-utils/ipcrm.c
index 6443f48..b17590a 100644
--- a/sys-utils/ipcrm.c
+++ b/sys-utils/ipcrm.c
@@ -47,8 +47,8 @@ static int verbose = 0;
static void __attribute__ ((__noreturn__)) usage(FILE * out)
{
fprintf(out, USAGE_HEADER);
- fprintf(out, " %s [options]\n", program_invocation_short_name);
- fprintf(out, " %s shm|msg|sem <id>...\n", program_invocation_short_name);
+ fprintf(out, _(" %s [options]\n"
+ " %s shm|msg|sem <id>...\n"), program_invocation_short_name);
fprintf(out, USAGE_OPTIONS);
fputs(_(" -m, --shmem-id <id> remove shared memory segment by id\n"), out);
fputs(_(" -M, --shmem-key <key> remove shared memory segment by key\n"), out);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 04/10] docs: restore the alternative form of setarch in its man page
2014-12-24 16:56 [PATCH 01/10] docs: improve some wordings on the man page of wipefs Benno Schulenberg
2014-12-24 16:56 ` [PATCH 02/10] ipcs: in usage show resource option as nonoptional when used with -i Benno Schulenberg
2014-12-24 16:56 ` [PATCH 03/10] ipcrm: gettextize the command synopsis of the usage text Benno Schulenberg
@ 2014-12-24 16:56 ` Benno Schulenberg
2014-12-24 16:56 ` [PATCH 05/10] setarch: make the usage synopsis comprehensible for translators Benno Schulenberg
` (5 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: Benno Schulenberg @ 2014-12-24 16:56 UTC (permalink / raw)
To: util-linux
Commit c372860ddb4a768f7f6c50cd26d60119370d5cd accidentally removed
the alternative form of setarch in which the command name specifies
the architecture to be set. Also improve some formatting.
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
---
sys-utils/setarch.8 | 21 +++++++++++----------
1 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/sys-utils/setarch.8 b/sys-utils/setarch.8
index ad9d4c2..a9a126a 100644
--- a/sys-utils/setarch.8
+++ b/sys-utils/setarch.8
@@ -1,4 +1,4 @@
-.TH SETARCH 8 "July 2014" "util-linux" "System Administration"
+.TH SETARCH 8 "December 2014" "util-linux" "System Administration"
.SH NAME
setarch \- change reported architecture in new program environment and set personality flags
.SH SYNOPSIS
@@ -6,21 +6,22 @@ setarch \- change reported architecture in new program environment and set perso
.I arch
[options]
.RI [ program
-.RI [ arguments ]]
+.RI [ argument ...]]
+.sp
+.B arch
+[options]
+.RI [ program
+.RI [ argument ...]]
.sp
.B setarch
.BR \-\-list | \-h | \-V
.SH DESCRIPTION
.B setarch
currently only affects the output of \fBuname -m\fR.
-For example, on an AMD64 system, running 'setarch i386 program' will cause 'program' to see
-.IR i686
-instead of
-.IR x86_64
-as the machine type. It also allows to set various personality options.
-The default
-.B program
-is /bin/sh.
+For example, on an AMD64 system, running \fBsetarch i386 \fIprogram\fR
+will cause \fIprogram\fR to see i686 instead of x86_64 as the machine type.
+It also allows to set various personality options.
+The default \fIprogram\fR is \fB/bin/sh\fR.
.SH OPTIONS
.TP
\fB\-\-list\fR
--
1.7.0.4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 05/10] setarch: make the usage synopsis comprehensible for translators
2014-12-24 16:56 [PATCH 01/10] docs: improve some wordings on the man page of wipefs Benno Schulenberg
` (2 preceding siblings ...)
2014-12-24 16:56 ` [PATCH 04/10] docs: restore the alternative form of setarch in its man page Benno Schulenberg
@ 2014-12-24 16:56 ` Benno Schulenberg
2014-12-24 16:56 ` [PATCH 06/10] textual: list the options of setarch in a more alphabetical order Benno Schulenberg
` (4 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: Benno Schulenberg @ 2014-12-24 16:56 UTC (permalink / raw)
To: util-linux
Use two separate strings for the two different forms of setarch,
instead of filling in an untranslated word into a single string.
Also use the standard angular brackets for nonliteral arguments.
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
---
sys-utils/setarch.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/sys-utils/setarch.c b/sys-utils/setarch.c
index ed2a6a6..e00198c 100644
--- a/sys-utils/setarch.c
+++ b/sys-utils/setarch.c
@@ -91,9 +91,10 @@ enum {
static void __attribute__((__noreturn__)) show_help(void)
{
fputs(USAGE_HEADER, stdout);
- printf(_(" %s%s [options] [program [program arguments]]\n"),
- program_invocation_short_name,
- !strcmp(program_invocation_short_name, "setarch") ? " <arch>" : "");
+ if (!strcmp(program_invocation_short_name, "setarch"))
+ printf(_(" %s <arch> [options] [<program> [<argument>...]]\n"), program_invocation_short_name);
+ else
+ printf(_(" %s [options] [<program> [<argument>...]]\n"), program_invocation_short_name);
fputs(USAGE_OPTIONS, stdout);
fputs(_(" -v, --verbose says what options are being switched on\n"), stdout);
fputs(_(" -R, --addr-no-randomize disables randomization of the virtual address space\n"), stdout);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 06/10] textual: list the options of setarch in a more alphabetical order
2014-12-24 16:56 [PATCH 01/10] docs: improve some wordings on the man page of wipefs Benno Schulenberg
` (3 preceding siblings ...)
2014-12-24 16:56 ` [PATCH 05/10] setarch: make the usage synopsis comprehensible for translators Benno Schulenberg
@ 2014-12-24 16:56 ` Benno Schulenberg
2014-12-24 16:56 ` [PATCH 07/10] colcrt: slice up the usage text for ease of translation Benno Schulenberg
` (3 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: Benno Schulenberg @ 2014-12-24 16:56 UTC (permalink / raw)
To: util-linux
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
---
sys-utils/setarch.c | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/sys-utils/setarch.c b/sys-utils/setarch.c
index e00198c..73329a4 100644
--- a/sys-utils/setarch.c
+++ b/sys-utils/setarch.c
@@ -95,25 +95,28 @@ static void __attribute__((__noreturn__)) show_help(void)
printf(_(" %s <arch> [options] [<program> [<argument>...]]\n"), program_invocation_short_name);
else
printf(_(" %s [options] [<program> [<argument>...]]\n"), program_invocation_short_name);
+
fputs(USAGE_OPTIONS, stdout);
- fputs(_(" -v, --verbose says what options are being switched on\n"), stdout);
- fputs(_(" -R, --addr-no-randomize disables randomization of the virtual address space\n"), stdout);
- fputs(_(" -F, --fdpic-funcptrs makes function pointers point to descriptors\n"), stdout);
- fputs(_(" -Z, --mmap-page-zero turns on MMAP_PAGE_ZERO\n"), stdout);
- fputs(_(" -L, --addr-compat-layout changes the way virtual memory is allocated\n"), stdout);
- fputs(_(" -X, --read-implies-exec turns on READ_IMPLIES_EXEC\n"), stdout);
fputs(_(" -B, --32bit turns on ADDR_LIMIT_32BIT\n"), stdout);
+ fputs(_(" -F, --fdpic-funcptrs makes function pointers point to descriptors\n"), stdout);
fputs(_(" -I, --short-inode turns on SHORT_INODE\n"), stdout);
+ fputs(_(" -L, --addr-compat-layout changes the way virtual memory is allocated\n"), stdout);
+ fputs(_(" -R, --addr-no-randomize disables randomization of the virtual address space\n"), stdout);
fputs(_(" -S, --whole-seconds turns on WHOLE_SECONDS\n"), stdout);
fputs(_(" -T, --sticky-timeouts turns on STICKY_TIMEOUTS\n"), stdout);
+ fputs(_(" -X, --read-implies-exec turns on READ_IMPLIES_EXEC\n"), stdout);
+ fputs(_(" -Z, --mmap-page-zero turns on MMAP_PAGE_ZERO\n"), stdout);
fputs(_(" -3, --3gb limits the used address space to a maximum of 3 GB\n"), stdout);
fputs(_(" --4gb ignored (for backward compatibility only)\n"), stdout);
fputs(_(" --uname-2.6 turns on UNAME26\n"), stdout);
+ fputs(_(" -v, --verbose say what options are being switched on\n"), stdout);
fputs(_(" --list list settable architectures, and exit\n"), stdout);
+
fputs(USAGE_SEPARATOR, stdout);
fputs(USAGE_HELP, stdout);
fputs(USAGE_VERSION, stdout);
printf(USAGE_MAN_TAIL("setarch(8)"));
+
exit(EXIT_SUCCESS);
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 07/10] colcrt: slice up the usage text for ease of translation
2014-12-24 16:56 [PATCH 01/10] docs: improve some wordings on the man page of wipefs Benno Schulenberg
` (4 preceding siblings ...)
2014-12-24 16:56 ` [PATCH 06/10] textual: list the options of setarch in a more alphabetical order Benno Schulenberg
@ 2014-12-24 16:56 ` Benno Schulenberg
2014-12-24 16:56 ` [PATCH 08/10] look: " Benno Schulenberg
` (2 subsequent siblings)
8 siblings, 0 replies; 13+ messages in thread
From: Benno Schulenberg @ 2014-12-24 16:56 UTC (permalink / raw)
To: util-linux
Also use the standard macros for outputting it.
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
---
text-utils/colcrt.c | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/text-utils/colcrt.c b/text-utils/colcrt.c
index c39c8b6..21013ea 100644
--- a/text-utils/colcrt.c
+++ b/text-utils/colcrt.c
@@ -309,16 +309,17 @@ void move(int l, int m)
static void __attribute__ ((__noreturn__)) usage(FILE * out)
{
- fprintf(out,
- _("\nUsage:\n"
- " %s [options] [file ...]\n"), program_invocation_short_name);
+ fputs(USAGE_HEADER, out);
+ fprintf(out, _(" %s [options] [<file>...]\n"), program_invocation_short_name);
- fprintf(out,
- _(" -, --no-underlining suppress all underlining\n"
- " -2, --half-lines print all half-lines\n"
- " -V, --version output version information and exit\n"
- " -h, --help display this help and exit\n\n"));
+ fputs(USAGE_OPTIONS, out);
+ fputs(_(" -, --no-underlining suppress all underlining\n"), out);
+ fputs(_(" -2, --half-lines print all half-lines\n"), out);
+ fputs(USAGE_SEPARATOR, out);
+ fputs(USAGE_HELP, out);
+ fputs(USAGE_VERSION, out);
fprintf(out, USAGE_MAN_TAIL("colcrt(1)"));
+
exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 08/10] look: slice up the usage text for ease of translation
2014-12-24 16:56 [PATCH 01/10] docs: improve some wordings on the man page of wipefs Benno Schulenberg
` (5 preceding siblings ...)
2014-12-24 16:56 ` [PATCH 07/10] colcrt: slice up the usage text for ease of translation Benno Schulenberg
@ 2014-12-24 16:56 ` Benno Schulenberg
2014-12-24 16:56 ` [PATCH 09/10] tailf: " Benno Schulenberg
2014-12-24 16:56 ` [PATCH 10/10] ipc*: use customary fputs() instead of fprintf() with the usage macros Benno Schulenberg
8 siblings, 0 replies; 13+ messages in thread
From: Benno Schulenberg @ 2014-12-24 16:56 UTC (permalink / raw)
To: util-linux
Also use the standard macros, and correct the synopsis: use angular
brackets and show that look accepts multiple files.
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
---
misc-utils/look.c | 20 +++++++++++---------
1 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/misc-utils/look.c b/misc-utils/look.c
index 51938f2..d6a8e26 100644
--- a/misc-utils/look.c
+++ b/misc-utils/look.c
@@ -364,16 +364,18 @@ compare(char *s2, char *s2end) {
static void __attribute__ ((__noreturn__)) usage(FILE * out)
{
fputs(USAGE_HEADER, out);
- fprintf(out,
- _(" %s [options] string [file]\n"), program_invocation_short_name);
- fputs(USAGE_OPTIONS, out);
- fputs(_(" -a, --alternative use alternative dictionary\n"
- " -d, --alphanum compare only alphanumeric characters\n"
- " -f, --ignore-case ignore case differences when comparing\n"
- " -t, --terminate <char> define string termination character\n"
- " -V, --version output version information and exit\n"
- " -h, --help display this help and exit\n\n"), out);
+ fprintf(out, _(" %s [options] <string> [<file>...]\n"), program_invocation_short_name);
+ fputs(USAGE_OPTIONS, out);
+ fputs(_(" -a, --alternative use the alternative dictionary\n"), out);
+ fputs(_(" -d, --alphanum compare only alphanumeric characters\n"), out);
+ fputs(_(" -f, --ignore-case ignore case differences when comparing\n"), out);
+ fputs(_(" -t, --terminate <char> define the string-termination character\n"), out);
+
+ fputs(USAGE_SEPARATOR, out);
+ fputs(USAGE_HELP, out);
+ fputs(USAGE_VERSION, out);
fprintf(out, USAGE_MAN_TAIL("look(1)"));
+
exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 09/10] tailf: slice up the usage text for ease of translation
2014-12-24 16:56 [PATCH 01/10] docs: improve some wordings on the man page of wipefs Benno Schulenberg
` (6 preceding siblings ...)
2014-12-24 16:56 ` [PATCH 08/10] look: " Benno Schulenberg
@ 2014-12-24 16:56 ` Benno Schulenberg
2014-12-24 16:56 ` [PATCH 10/10] ipc*: use customary fputs() instead of fprintf() with the usage macros Benno Schulenberg
8 siblings, 0 replies; 13+ messages in thread
From: Benno Schulenberg @ 2014-12-24 16:56 UTC (permalink / raw)
To: util-linux
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
---
text-utils/tailf.c | 21 ++++++++++-----------
1 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/text-utils/tailf.c b/text-utils/tailf.c
index bd38da2..7dea599 100644
--- a/text-utils/tailf.c
+++ b/text-utils/tailf.c
@@ -193,19 +193,18 @@ watch_file_inotify(const char *filename, off_t *size)
static void __attribute__ ((__noreturn__)) usage(FILE *out)
{
- fprintf(out,
- _("\nUsage:\n"
- " %s [option] file\n"),
- program_invocation_short_name);
-
- fprintf(out, _(
- "\nOptions:\n"
- " -n, --lines NUMBER output the last NUMBER lines\n"
- " -NUMBER same as `-n NUMBER'\n"
- " -V, --version output version information and exit\n"
- " -h, --help display this help and exit\n\n"));
+ fputs(USAGE_HEADER, out);
+ fprintf(out, _(" %s [option] <file>\n"), program_invocation_short_name);
+ fputs(USAGE_OPTIONS, out);
+ fputs(_(" -n, --lines <number> output the last <number> lines\n"), out);
+ fputs(_(" -<number> same as '-n <number>'\n"), out);
+
+ fputs(USAGE_SEPARATOR, out);
+ fputs(USAGE_HELP, out);
+ fputs(USAGE_VERSION, out);
fprintf(out, USAGE_MAN_TAIL("tailf(1)"));
+
exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 10/10] ipc*: use customary fputs() instead of fprintf() with the usage macros
2014-12-24 16:56 [PATCH 01/10] docs: improve some wordings on the man page of wipefs Benno Schulenberg
` (7 preceding siblings ...)
2014-12-24 16:56 ` [PATCH 09/10] tailf: " Benno Schulenberg
@ 2014-12-24 16:56 ` Benno Schulenberg
8 siblings, 0 replies; 13+ messages in thread
From: Benno Schulenberg @ 2014-12-24 16:56 UTC (permalink / raw)
To: util-linux
Also use the clearer word <number> with the --semaphore option.
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
---
sys-utils/ipcmk.c | 13 +++++++------
sys-utils/ipcrm.c | 13 ++++++++-----
sys-utils/ipcs.c | 16 ++++++++++------
3 files changed, 25 insertions(+), 17 deletions(-)
diff --git a/sys-utils/ipcmk.c b/sys-utils/ipcmk.c
index 3ff021e..1c5987f 100644
--- a/sys-utils/ipcmk.c
+++ b/sys-utils/ipcmk.c
@@ -62,19 +62,20 @@ static int create_sem(int nsems, int permission)
static void __attribute__ ((__noreturn__)) usage(FILE * out)
{
- fprintf(out, USAGE_HEADER);
+ fputs(USAGE_HEADER, out);
fprintf(out, _(" %s [options]\n"), program_invocation_short_name);
- fprintf(out, USAGE_OPTIONS);
+ fputs(USAGE_OPTIONS, out);
fputs(_(" -M, --shmem <size> create shared memory segment of size <size>\n"), out);
- fputs(_(" -S, --semaphore <nsems> create semaphore array with <nsems> elements\n"), out);
+ fputs(_(" -S, --semaphore <number> create semaphore array with <number> elements\n"), out);
fputs(_(" -Q, --queue create message queue\n"), out);
fputs(_(" -p, --mode <mode> permission for the resource (default is 0644)\n"), out);
- fprintf(out, USAGE_SEPARATOR);
- fprintf(out, USAGE_HELP);
- fprintf(out, USAGE_VERSION);
+ fputs(USAGE_SEPARATOR, out);
+ fputs(USAGE_HELP, out);
+ fputs(USAGE_VERSION, out);
fprintf(out, USAGE_MAN_TAIL("ipcmk(1)"));
+
exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
}
diff --git a/sys-utils/ipcrm.c b/sys-utils/ipcrm.c
index b17590a..48d5c06 100644
--- a/sys-utils/ipcrm.c
+++ b/sys-utils/ipcrm.c
@@ -46,10 +46,11 @@ static int verbose = 0;
/* print the usage */
static void __attribute__ ((__noreturn__)) usage(FILE * out)
{
- fprintf(out, USAGE_HEADER);
+ fputs(USAGE_HEADER, out);
fprintf(out, _(" %s [options]\n"
" %s shm|msg|sem <id>...\n"), program_invocation_short_name);
- fprintf(out, USAGE_OPTIONS);
+
+ fputs(USAGE_OPTIONS, out);
fputs(_(" -m, --shmem-id <id> remove shared memory segment by id\n"), out);
fputs(_(" -M, --shmem-key <key> remove shared memory segment by key\n"), out);
fputs(_(" -q, --queue-id <id> remove message queue by id\n"), out);
@@ -58,10 +59,12 @@ static void __attribute__ ((__noreturn__)) usage(FILE * out)
fputs(_(" -S, --semaphore-key <key> remove semaphore by key\n"), out);
fputs(_(" -a, --all[=shm|msg|sem] remove all (in the specified category)\n"), out);
fputs(_(" -v, --verbose explain what is being done\n"), out);
- fprintf(out, USAGE_SEPARATOR);
- fprintf(out, USAGE_HELP);
- fprintf(out, USAGE_VERSION);
+
+ fputs(USAGE_SEPARATOR, out);
+ fputs(USAGE_HELP, out);
+ fputs(USAGE_VERSION, out);
fprintf(out, USAGE_MAN_TAIL("ipcrm(1)"));
+
exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
}
diff --git a/sys-utils/ipcs.c b/sys-utils/ipcs.c
index 440a39e..d64519a 100644
--- a/sys-utils/ipcs.c
+++ b/sys-utils/ipcs.c
@@ -49,20 +49,23 @@ static void print_msg (int id, int unit);
static void __attribute__ ((__noreturn__)) usage(FILE * out)
{
- fprintf(out, USAGE_HEADER);
+ fputs(USAGE_HEADER, out);
fprintf(out, _(" %1$s [resource-option...] [output-option]\n"
" %1$s -m|-q|-s -i <id>\n"), program_invocation_short_name);
- fprintf(out, USAGE_OPTIONS);
+
+ fputs(USAGE_OPTIONS, out);
fputs(_(" -i, --id <id> print details on resource identified by <id>\n"), out);
- fprintf(out, USAGE_HELP);
- fprintf(out, USAGE_VERSION);
- fprintf(out, USAGE_SEPARATOR);
+ fputs(USAGE_HELP, out);
+ fputs(USAGE_VERSION, out);
+
+ fputs(USAGE_SEPARATOR, out);
fputs(_("Resource options:\n"), out);
fputs(_(" -m, --shmems shared memory segments\n"), out);
fputs(_(" -q, --queues message queues\n"), out);
fputs(_(" -s, --semaphores semaphores\n"), out);
fputs(_(" -a, --all all (default)\n"), out);
- fprintf(out, USAGE_SEPARATOR);
+
+ fputs(USAGE_SEPARATOR, out);
fputs(_("Output options:\n"), out);
fputs(_(" -t, --time show attach, detach and change times\n"), out);
fputs(_(" -p, --pid show PIDs of creator and last operator\n"), out);
@@ -72,6 +75,7 @@ static void __attribute__ ((__noreturn__)) usage(FILE * 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);
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH 02/10] ipcs: in usage show resource option as nonoptional when used with -i
2014-12-24 16:56 ` [PATCH 02/10] ipcs: in usage show resource option as nonoptional when used with -i Benno Schulenberg
@ 2014-12-29 10:09 ` Benno Schulenberg
2015-01-06 10:57 ` Karel Zak
0 siblings, 1 reply; 13+ messages in thread
From: Benno Schulenberg @ 2014-12-29 10:09 UTC (permalink / raw)
To: Util-Linux
On Wed, Dec 24, 2014, at 17:56, Benno Schulenberg wrote:
> fprintf(out, USAGE_HEADER);
> - fprintf(out, " %s [resource ...] [output-format]\n", program_invocation_short_name);
> - fprintf(out, " %s [resource] -i <id>\n", program_invocation_short_name);
> + fprintf(out, _(" %1$s [resource-option...] [output-option]\n"
> + " %1$s -m|-q|-s -i <id>\n"), program_invocation_short_name);
> fprintf(out, USAGE_OPTIONS);
Ow... Most of these patching will need rebasing when the docstring
patch has been applied. Have done that locally and will resubmit.
Benno
--
http://www.fastmail.com - Same, same, but different...
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 02/10] ipcs: in usage show resource option as nonoptional when used with -i
2014-12-29 10:09 ` Benno Schulenberg
@ 2015-01-06 10:57 ` Karel Zak
0 siblings, 0 replies; 13+ messages in thread
From: Karel Zak @ 2015-01-06 10:57 UTC (permalink / raw)
To: Benno Schulenberg; +Cc: Util-Linux
On Mon, Dec 29, 2014 at 11:09:58AM +0100, Benno Schulenberg wrote:
>
> On Wed, Dec 24, 2014, at 17:56, Benno Schulenberg wrote:
> > fprintf(out, USAGE_HEADER);
> > - fprintf(out, " %s [resource ...] [output-format]\n", program_invocation_short_name);
> > - fprintf(out, " %s [resource] -i <id>\n", program_invocation_short_name);
> > + fprintf(out, _(" %1$s [resource-option...] [output-option]\n"
> > + " %1$s -m|-q|-s -i <id>\n"), program_invocation_short_name);
> > fprintf(out, USAGE_OPTIONS);
>
> Ow... Most of these patching will need rebasing when the docstring
> patch has been applied. Have done that locally and will resubmit.
Unnecessary, I did it locally and merged an pushed all.
Thanks!
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 03/10] ipcrm: gettextize the command synopsis of the usage text
2014-12-24 16:56 ` [PATCH 03/10] ipcrm: gettextize the command synopsis of the usage text Benno Schulenberg
@ 2015-01-06 10:58 ` Karel Zak
0 siblings, 0 replies; 13+ messages in thread
From: Karel Zak @ 2015-01-06 10:58 UTC (permalink / raw)
To: Benno Schulenberg; +Cc: util-linux
On Wed, Dec 24, 2014 at 05:56:03PM +0100, Benno Schulenberg wrote:
> - fprintf(out, " %s [options]\n", program_invocation_short_name);
> - fprintf(out, " %s shm|msg|sem <id>...\n", program_invocation_short_name);
> + fprintf(out, _(" %s [options]\n"
> + " %s shm|msg|sem <id>...\n"), program_invocation_short_name);
Forgot "%1$s" ;-) Fixed.
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2015-01-06 10:58 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-24 16:56 [PATCH 01/10] docs: improve some wordings on the man page of wipefs Benno Schulenberg
2014-12-24 16:56 ` [PATCH 02/10] ipcs: in usage show resource option as nonoptional when used with -i Benno Schulenberg
2014-12-29 10:09 ` Benno Schulenberg
2015-01-06 10:57 ` Karel Zak
2014-12-24 16:56 ` [PATCH 03/10] ipcrm: gettextize the command synopsis of the usage text Benno Schulenberg
2015-01-06 10:58 ` Karel Zak
2014-12-24 16:56 ` [PATCH 04/10] docs: restore the alternative form of setarch in its man page Benno Schulenberg
2014-12-24 16:56 ` [PATCH 05/10] setarch: make the usage synopsis comprehensible for translators Benno Schulenberg
2014-12-24 16:56 ` [PATCH 06/10] textual: list the options of setarch in a more alphabetical order Benno Schulenberg
2014-12-24 16:56 ` [PATCH 07/10] colcrt: slice up the usage text for ease of translation Benno Schulenberg
2014-12-24 16:56 ` [PATCH 08/10] look: " Benno Schulenberg
2014-12-24 16:56 ` [PATCH 09/10] tailf: " Benno Schulenberg
2014-12-24 16:56 ` [PATCH 10/10] ipc*: use customary fputs() instead of fprintf() with the usage macros Benno Schulenberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).