Commit Graph

356 Commits

Author SHA1 Message Date
Sami Kerola 2fb35353fd uuidd: remove goto statement
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-25 14:58:35 +02:00
Sami Kerola 41dc5bc097 uuidd: use symbolic exit and return values
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-25 14:53:50 +02:00
Sami Kerola ea091bed63 uuidd: die() function removed
The function is replaced with err().

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-25 14:46:47 +02:00
Sami Kerola f0ef0b58dc uuidd: long options & new usage
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-25 14:36:34 +02:00
Sami Kerola 309e6a4915 docs: uuidgen.1 mention long options
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-25 14:29:06 +02:00
Sami Kerola 0379a55d9f uuidgen: add long options
Affects to help output as well.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-25 14:28:56 +02:00
Sami Kerola 094678122e wipefs: add version printing & compiler warning
The --version option is added, and a storage type is fixed to
correct a compiler warnings.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-25 14:28:17 +02:00
Sami Kerola 4aa9d65bfa build-sys: move write to term-utils directory
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-25 13:54:31 +02:00
Sami Kerola 8839c0f60f misc-utils: remove misleading README files
Clean up of files which primarily caused confusion.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-25 13:45:27 +02:00
Sami Kerola 03b3d715de docs: rename.1 verbose, long options and warning
Add new verbose and long options to manual page. I also added
warning section which hopefully gets read by people who run the
command first time.

It might be good idea to make the rename such that it would not
overwrite by default, and have a --force option if an use wants
that. In current state the rename is somewhat dangerous.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-25 13:45:27 +02:00
Sami Kerola d200a926df rename: verbose option & maintenance fixes
The rename has new verbose option which will print which files
where renamed. Maintenance fixes includes long options, coding
style and freeing memory after usage.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-25 13:45:27 +02:00
Sami Kerola 4b5a1ab8e4 docs: inform about cal long options
The parameters section is now split per a parameter, which I
found more readable than the previous layout. In addition the
nroff syntax is changed to be closer what help2man is suggesting
it should be.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-25 13:45:26 +02:00
Sami Kerola 33c1735400 cal: clean up few coding style issues
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-25 13:44:12 +02:00
Sami Kerola 21ba9798fb cal: fix compiler warnings
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-25 13:43:14 +02:00
Sami Kerola 022df321b1 cal: argument checking, long options and argument checking
Check numeric user inputs with strtol_on_err. Add long options
with nice looking usage.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-25 13:38:47 +02:00
Sami Kerola 30ad62d06f whereis: coding style
Changes only placement of braces, spacing, tabs etc.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-25 13:29:59 +02:00
Sami Kerola 32ae96aecf whereis: warnings, exit values, braces and returns
Compiler type mismatch warning fixed, symbolic exit value taken
in use where missing, unnecessary single statement 'block' braces
removed and return is not a function bracing fixed.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-25 13:29:30 +02:00
Sami Kerola 12b806427d whereis: remove goto statements
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-25 13:29:22 +02:00
Sami Kerola 5851336376 whereis: new usage output & version printing
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-25 13:20:01 +02:00
Sami Kerola e6ebab66d4 mcookie: change coding style
Now in align with README.devel.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-25 12:37:43 +02:00
Sami Kerola 177f48fa0c docs: inform about mcookie long options
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-25 12:37:38 +02:00
Sami Kerola e40f84b9d0 mcookie: use warnx, long options and help screen
Help and version options added. Additionally one compiler warning
got to be fixed.

mcookie.c:115:18: warning: comparison of integers of different signs: 'int' and 'unsigned long'

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-25 12:37:37 +02:00
Sami Kerola 5a0d925569 namei: fix to argument handling
Missing pathname argument can only be checked after options are
parsed. Earlier for example 'namei -l' print nothing and was
successful.

The option parsing is changed to be less POSIXLY_CORRECT and
continue if nonoption argument is found, which allows users to
define options and arguments in the order they prefer.

Unknown short options, which earlier matched case '?' that was
help option alias, are now made to indicate failure in return
value.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-25 12:37:37 +02:00
Sami Kerola b977951749 namei: use xalloc.h
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-25 12:37:37 +02:00
Sami Kerola 64718fe7d9 namei: add --version option
Add to namei.1 man also the --help option along with the new
--version.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-06-25 12:37:04 +02:00
Karel Zak 70db6c7ef4 blkid: list all known filesystems/RAIDs (add -k option)
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-06-20 16:42:03 +02:00
Karel Zak 8fec558bc3 namei: remove unused variable
namei.c: In function ‘print_namei’:
namei.c:368:16: warning: variable ‘prev’ set but not used [-Wunused-but-set-variable]

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-06-08 12:18:49 +02:00
Karel Zak bc867ea388 blkid: don't free() uninitialized variable
blkid.c: In function ‘main’:
blkid.c:656:6: warning: ‘res’ may be used uninitialized in this function [-Wuninitialized]
blkid.c:623:9: note: ‘res’ was declared here

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-06-08 12:16:08 +02:00
Francesco Cosoleto 5d2a98490e This adds a second parameter to size_to_human_string() to return a
string with a different format based on the following flags:

        SIZE_SUFFIX_1LETTER  = "1K"
        SIZE_SUFFIX_3LETTER  = "1KiB",
        SIZE_SUFFIX_SPACE    = "1 KiB" or "1 K"

[kzak@redhat.com: - rename flags to SIZE_SUFFIX_* format,
                  - fix suffix[] buffer size
                  - add 3 letter version to the test]

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-05-26 15:32:33 +02:00
Karel Zak 9cfe1b9c6a lsblk: use sysfs_read_u64() rather than sysfs_strdup() + atol()
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-05-18 12:17:43 +02:00
Karel Zak 90e9fcda3b lib: [sysfs.c] make sysfs_read_* function more robust
The functions does not modify result if the requested sysfs attribute
does not exist.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-05-18 11:57:17 +02:00
Martin K. Petersen 98055888e9 lsblk: improve discard support
Use atol() instead of atoi() when extracting discard_max_bytes.

Only print discard_alignment and discard_zeroes_data if the device
supports discard. This prevents printing of undefined values with older
kernels.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2011-05-18 11:13:36 +02:00
Karel Zak 766ab9b08d lsblk: use generic sysfs functions
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-05-16 20:22:52 +02:00
Karel Zak b152e3595c findmnt: add columns description to the --help output
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-05-10 12:06:39 +02:00
Karel Zak 49e9fd3a0d findmnt: add --pairs to output in key="value" format
... usable in scripts, for example:

findmnt --pairs -o "SOURCE,TARGET,FSTYPE" $1 | while read line; do
        eval $line
        echo "$SOURCE is mounted on $TARGET [$FSTYPE]"
done

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-05-10 11:16:41 +02:00
Karel Zak d783ee0be0 findmnt: fix leak
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-05-10 10:39:14 +02:00
Karel Zak 6ea1bdd32c lsblk: add --pairs to output in key="value" format
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-05-10 10:38:29 +02:00
Martin K. Petersen 2d2322461c lsblk: add support for discard topology (-D option)
I got tired of poking around in sysfs to find the discard topology.
Here's a patch against lsblk that adds a -D option to present this
information in a human-readable form:

NAME                  DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO
sda                          0        0B       0B         0
└─sda1                       0        0B       0B         0
sdb                          0      512B       2G         1
└─sdb1                       0      512B       2G         1

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-05-05 10:09:26 +02:00
Karel Zak af0dc7d3b5 findmnt: minor coding style changes
* remove __<MACRONAME> from code
 * use 'static' for global variables

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-27 23:06:07 +02:00
Karel Zak 582a5006d4 findmnt: filter filesystems and actions for --poll
The patch allows to filter by:

 * actions name:
	$ findmnt --poll=umount

 * target, source, fstype, options:
	$ findmnt --poll /mnt/test
	$ findmnt --poll -O ro
	$ findmnt --poll -t ext4

 * --first-only option to wait only for the first matching change:

	$ findmnt --poll=umount --first-only /mnt/test

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-27 22:59:00 +02:00
Karel Zak 77a1c5f7c9 findmnt: print OLD-* columns only when necessary
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-27 18:09:41 +02:00
Karel Zak a8862fab94 findmnt: add --poll and --timeout to the man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-27 18:07:39 +02:00
Karel Zak ad38fb9f9f findmnt: add --timeout option
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-27 17:39:25 +02:00
Karel Zak 32e5466aa7 findmnt: add --poll option
The --poll functionality is based on poll(/proc/self/mountinfo) and
mnt_tabdiff_* functions from libmount.

 $ findmnt --poll
 ACTION     TARGET    SOURCE    FSTYPE OPTIONS
 mount      /mnt/test /dev/sda1 ext3   rw,relatime,errors=continue,user_xattr,acl,barrier=0,data=ordered

... after "mount /dev/sda1 /mnt/test".

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-04-27 17:19:04 +02:00
Sergey Gusarov 305a612251 blkid: small fix for safe_print()
This small fix makes it possible to print the first unprintable character
with code 128 from ASCII table.

Signed-off-by: Sergey Gusarov <laborer2008@gmail.com>
2011-03-29 17:07:24 +02:00
Karel Zak 36a74e1b45 blkid: add -d option to print non-printable chars
Reported-by: laborer2008 laborer <laborer2008@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-29 11:44:29 +02:00
Karel Zak 95cc3573e1 ddate: use ARRAY_SIZE
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-18 10:27:09 +01:00
Karel Zak 2534eb3003 ddate: remove non-ascii chars from ddate
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-18 10:25:42 +01:00
Karel Zak 37beb702a8 blkid: fix double free [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-11 16:12:20 +01:00
Karel Zak feb81b6897 lib: [tt.c] use mbs_truncate() from mbsalign.c
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-11 15:30:27 +01:00