ls: rename --null to --zero (Bug#49716)

* NEWS, doc/coreutils.texi (General output formatting):
* src/ls.c (usage):
Document this.
* src/ls.c (ZERO_OPTION): Rename from NULL_OPTION.
All uses changed.
(long_options): Rename --null to --zero.
(dired_dump_obstack, main, print_dir): Use '\n' instead of
eolbyte where eolbyte must equal '\n'.
(decode_switches): Decode --zero instead of --null.
--zero also implies -1, -N, --color=none, --show-control-chars.
Use easier-to-decipher code to set ‘format’ and ‘dired’.
Reject attempts to combine --dired and --zero.
* tests/local.mk: Adjust to test script renaming.
* tests/ls/zero-option.sh: Rename from tests/ls/null-option.sh,
and test --zero instead of --null.
This commit is contained in:
Paul Eggert
2021-07-27 17:34:43 -07:00
parent 9e4a6101f2
commit c75779cac3
5 changed files with 42 additions and 35 deletions

View File

@@ -1,5 +1,5 @@
#!/bin/sh
# Verify behavior of ls --null.
# Verify behavior of ls --zero.
# Copyright 2021 Free Software Foundation, Inc.
@@ -21,7 +21,7 @@ print_ver_ ls
mkdir dir && touch dir/a dir/b dir/cc || framework_failure_
LC_ALL=C ls --null dir >out || fail=1
LC_ALL=C ls --zero dir >out || fail=1
tr '\n' '\0' <<EOF >exp
a
b