Commit graph

21 commits

Author SHA1 Message Date
Ruediger Meier
f45f3ec34a misc: consolidate macro style USAGE_HELP_OPTIONS
changed in include/c.h and applied via sed:

  sed -i 's/fprintf.*\(USAGE_MAN_TAIL.*\)/printf(\1/' $(git ls-files -- "*.c")
  sed -i 's/print_usage_help_options\(.*\);/printf(USAGE_HELP_OPTIONS\1);/' $(git ls-files -- "*.c")

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2017-06-29 16:54:33 +02:00
Ruediger Meier
b1a294c448 misc: introduce print_usage_help_options()
Consolidate --help and --version descriptions. We are
now able to align them to the other options.

We changed include/c.h. The rest of this patch was
generated by sed, plus manually setting the right
alignment numbers. We do not change anything but
white spaces in the --help output.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2017-06-27 12:26:19 +02:00
Ruediger Meier
6e1eda6f22 misc: never use usage(stderr)
Here we fix all cases where we have usage(FILE*)
functions.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2017-06-26 14:38:24 +02:00
Karel Zak
677ec86cef Use --help suggestion on invalid option
The current default is to print all usage() output. This is overkill
in many case.

Addresses: https://github.com/karelzak/util-linux/issues/338
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-19 13:13:34 +01:00
Sami Kerola
74ce680a3e
misc: simplify if clauses [oclint]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2016-07-21 21:14:33 +01:00
Sami Kerola
aeb9298d3e setsid: fix argument count bug
The below demonstrates what happen before this change.

$ setsid --wait
setsid: child 3252 did not exit normally: Success

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2016-03-14 13:15:13 +01:00
Benno Schulenberg
451dbcfae1 textual: add a docstring to most of the utilities
This adds a concise description of a tool to its usage text.

A first form of this patch was proposed by Steven Honeyman
(see http://www.spinics.net/lists/util-linux-ng/msg09994.html).

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-06 11:27:38 +01:00
Daniel Kahn Gillmor
0dde19974b setsid: add an option to wait child return value
This change proposed in util-linux maillist by Damien Wyart in behalf of
Daniel Kahn Gillmor.  Sami Kerola changed the patch to use option rather
than makign the default behavior of the command to change.

Reported-by: Damien Wyart <damien.wyart@gmail.com>
Reference: http://markmail.org/message/2z6qh5auk7wjie3l
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=495881
CC: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-08-01 11:31:47 +02:00
Sami Kerola
af6d266307 setsid: exit when control terminal cannot be set
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-26 13:26:01 +02:00
Sami Kerola
07ff972eb6 translation: unify exec error messages
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-02-06 11:51:17 +01:00
Benno Schulenberg
b50945d4ac textual: spell and encode the name of Arkadiusz Miśkiewicz correctly
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2013-02-06 11:15:02 +01:00
Bernhard Voelker
b4479ffaa8 setsid: fix off-by-one error in execvp call
Bug introduced during --ctty implementation by v2.21-112-g8a2f04d.

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
2012-06-15 11:42:43 +02:00
Thomas Schwinge
9766962478 setsid: Include <sys/ioctl.h> instead of <termio.h>.
Signed-off-by: Thomas Schwinge <thomas@codesourcery.com>
2012-05-29 10:11:43 +02:00
Sami Kerola
efb8854f4c sys-utils: verify writing to streams was successful
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-04-04 19:49:40 +02:00
Karel Zak
7c3c355fae setsid: cleanup usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-20 09:28:38 +01:00
Harald Hoyer
8a2f04ddca setsid: add option "-c" to set the controlling terminal
[kzak@redhat.com: - use STDIN_FILENO rather than 0]

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-03-20 09:22:54 +01:00
Harald Hoyer
37305c65e7 setsid: add "+" to getopt_long()
otherwise setsid wants to interpret <program> arguments

$ setsid sh -i
setsid: invalid option -- 'i'

Usage:
 setsid [options] <program> [arguments ...]

Signed-off-by: Harald Hoyer <harald@redhat.com>
2012-02-09 15:33:33 +01:00
Sami Kerola
cbfa325318 setsid: add long options and fix coding style
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-10-30 14:08:33 +01:00
Karel Zak
c07ebfa1e0 Imported from util-linux-2.11b tarball. 2006-12-07 00:25:46 +01:00
Karel Zak
7eda085c41 Imported from util-linux-2.9v tarball. 2006-12-07 00:25:39 +01:00
Karel Zak
6dbe3af945 Imported from util-linux-2.2 tarball. 2006-12-07 00:25:32 +01:00