summaryrefslogtreecommitdiff
path: root/tests/df
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2013-11-22 02:12:34 +0000
committerPádraig Brady <P@draigBrady.com>2013-11-27 01:39:11 +0000
commit799e10f3619ea7949a4f606b2f29b662daf31e3c (patch)
tree6f7ad75a9639931e62a55bb2623fac149efc48f0 /tests/df
parentc3523181bd487539f308113620564756c29279cc (diff)
downloadcoreutils-799e10f3619ea7949a4f606b2f29b662daf31e3c.tar.xz
df: add --output=file to directly output specified arguments
* src/df.c (usage): Document the new 'file' --output field. (get_dev): Add a new parameter to pass the specified argument from the command line through. Use '-' if a command line parameter is not being used. * doc/coreutils.texi (df invocation): Describe the new 'file' field. * tests/df/df-output.sh: Adjust all fields test, and add a specific test for --output=file. * NEWS: Mention the new feature.
Diffstat (limited to 'tests/df')
-rwxr-xr-xtests/df/df-output.sh14
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/df/df-output.sh b/tests/df/df-output.sh
index a10f2706b..83cdc93ee 100755
--- a/tests/df/df-output.sh
+++ b/tests/df/df-output.sh
@@ -67,11 +67,11 @@ compare exp out || fail=1
# that --o (without argument) is identical to the full list.
cat <<\EOF > exp || framework_failure_
-Filesystem Type Inodes IUsed IFree IUse% Size Used Avail Use% Mounted on
+Filesystem Type Inodes IUsed IFree IUse% Size Used Avail Use% File Mounted on
EOF
df -h --o=source,fstype,itotal,iused,iavail,ipcent \
- --o=size,used,avail,pcent,target '.' >out || fail=1
+ --o=size,used,avail,pcent,file,target '.' >out || fail=1
sed -e '1 {
s/ [ ]*/ /g
q
@@ -127,4 +127,14 @@ compare exp out2 || fail=1
df --help > out || fail=1
grep ' --output' out >/dev/null || { fail=1; cat out; }
+# Ensure that the FILE field contains the argument.
+cat <<\EOF > exp || framework_failure_
+.
+exp
+EOF
+
+df --output=file '.' exp >out || fail=1
+sed '1d' out > out2
+compare exp out2 || fail=1
+
Exit $fail