Commit Graph

26 Commits

Author SHA1 Message Date
Sami Kerola dcb87944c2
ctrlaltdel: display error message indicated by errno
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-03-29 20:19:11 +01:00
Karel Zak 2c308875a7 misc: consolidate version printing and close_stdout()
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-04-16 15:14:13 +02:00
Karel Zak 9ce2fef0d7 ctrlaltdel: use new ul_path_* API
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-06-21 13:07:46 +02:00
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 86be6a32d3 misc: cosmetics, remove argument from usage(FILE*)
This patch is trivial and changes nothing, because
we were always using usage(stdout)

Now all our usage() functions look very similar. If wanted we
could auto-generate another big cosmetical patch to remove all
the useless "FILE *out" constants and use printf and puts
rather than their f* friends. Such patch could be automatically
synchronized with the translation project (newlines!) to not
make the translators sick.

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
Casper Ti. Vector e52b58e627 ctrlaltdel: use reboot() provided by libc, assuming it is 1-adic. 2015-11-19 12:07:04 +01:00
Karel Zak 741d478eeb ctrlaltdel: use path.h to read /proc
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-10-27 11:56:51 +01:00
Sami Kerola 82cac34889
ctrlaltdel: display setting when ran without arguments
This is more useful than printing an error.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-10-18 18:03:57 +01:00
Sami Kerola 8137c98f83
ctrlaltdel: improve error messaging
Tell user what is wrong rather than print usage().

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-10-18 18:03:47 +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
Benno Schulenberg b73142b97a textual: not using angular brackets around literal arguments
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-10-01 09:37:06 +02:00
Karel Zak ee312c654b docs: fix "behaviour" vs. "behavior"
Sometimes we use "behaviour" and "behavior" in the same text, let's
use "behavior" only everywhere.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1011068
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-06 09:49:35 +02: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
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 667229ae6a ctrlaltdel: minor changes to usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-09-27 13:26:06 +02:00
Sami Kerola 6f162034d0 build-sys: fixes to USAGE_* macros
The USAGE_BEGIN_TAIL is removed as unnecessary.

In between command specific options and --help & --version
USAGE_SEPARATOR is inserted. For now the separator is empty line.

The USAGE_MAN_TAIL is changed to take an argument.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-09-17 15:07:52 +02:00
Sami Kerola 028f7ed83f ctrlaltdel: add version & help options
Including other necessary changes to usage().

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-09-17 14:25:20 +02:00
Fabian Groffen eb76ca98b0 build-sys: provide alternatives for err, errx, warn and warnx
Solaris lacks err, errx, warn and warnx.  This also means the err.h header
doesn't exist.  Removed err.h include from all files, and included err.h from
c.h instead if it exists, otherwise alternatives are provided.

Signed-off-by: Fabian Groffen <grobian@gentoo.org>
2011-02-14 17:45:24 +01:00
Marek Polacek 0c3e520240 ctrlaltdel: use err() instead of fprintf() and exit()
[kzak@redhat.com: - remove unnecessary program name from err(),
                  - use program_invocation_short_name]

Signed-off-by: Marek Polacek <mmpolacek@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-10-21 13:28:45 +02:00
Karel Zak c07ebfa1e0 Imported from util-linux-2.11b tarball. 2006-12-07 00:25:46 +01:00
Karel Zak 66ee8158b6 Imported from util-linux-2.10s tarball. 2006-12-07 00:25:44 +01:00
Karel Zak 7eda085c41 Imported from util-linux-2.9v tarball. 2006-12-07 00:25:39 +01:00
Karel Zak 5c36a0eb7c Imported from util-linux-2.9i tarball. 2006-12-07 00:25:37 +01:00
Karel Zak 6dbe3af945 Imported from util-linux-2.2 tarball. 2006-12-07 00:25:32 +01:00