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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
... 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>
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>
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>
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>