Commit Graph

23 Commits

Author SHA1 Message Date
Karel Zak 8e76d28dbd fsfreeze: remove unnecessary condition [lgtm scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-09-20 15:57:31 +02:00
Karel Zak 25b7045e5d misc: replaces atexit(close_stdout) with new close_stdout_atexit()
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-06-17 15:46:10 +02: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
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
Sami Kerola 8791804065 misc: do not use plain 0 as NULL [smatch scan]
text-utils/tailf.c:69:21: warning: Using plain integer as NULL pointer

Since many 'struct option' has used zero as NULL make them more readable in
same go by reindenting, and using named argument requirements.

Reference: https://lwn.net/Articles/93577/
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-02-20 12:58:49 +01:00
Yuri Chornoivan a7349ee315 docs: Fix word repetitions 2017-02-13 14:10:12 +01:00
Sami Kerola 8d42631e31 fsfreeze: move filesystem support info to manual page
Include btrfs, f2fs, and nilfs to list of supported filesystems, with note
the list can be incomplete.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2016-12-22 12:18:45 +01:00
Sami Kerola 6690ceed64 fsfreeze: remove unnecessary functions
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2016-12-22 12:18:45 +01: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
Benno Schulenberg fc14ceba5e textual: grammarize and harmonize the stat error message
The message "stat failed %s" seems to say that stat() failed to
do something, or failed to pass a test, but of course it means
that the statting of something failed.  So say so.  Also make
two very similar messages equal to this one.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-02-02 11:27:10 +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
Sami Kerola 5543aaad23 fsfreeze: tell user when mandatory option is not specified
This commit also removes use of internal magic values by replacing them
with a enum definition.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-04-05 13:56:00 +02:00
Karel Zak d4543f843d fsfreeze: check for collision between options
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-13 13:07:32 +01:00
Karel Zak 7de20424b7 fsfreeze: clean up usage(), add -V
- clean up usage()
 - add -V,--version
 - print usage() if not action specified
 - update man page

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-13 12:32:30 +01:00
Sami Kerola 289dcc9023 translation: unify file open error messages
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-07-16 18:18:22 +02:00
Sami Kerola add1b8afd0 translation: unify stat error messages
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-07-16 18:18:22 +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 a2aef6d928 fsfreeze: cleanup usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-16 13:12:08 +02:00
Karel Zak 6c7d5ae9a2 move struct option to .rodata
It does not make sense to have writable large arrays of "struct
option" on the stack.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-03 15:00:30 +01: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
Hajime Taira f0bef3ca0f fsfreeze: new command
[kzak@redhat.com: - cleanup
                  - add long options
                  - add note about DM to the man page
                  - use err.h and nls.h]

Signed-off-by: Hajime Taira <htaira@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-05-14 13:01:01 +02:00