refactor/polish ~ whitespace normalization (consistent indentation [either tabs *or* spaces], EOF EOLNs, no trailing whitespace)

This commit is contained in:
Roy Ivy III 2020-05-10 21:14:58 -05:00
parent 3877cf4bd3
commit 6606408ce9
10 changed files with 273 additions and 273 deletions

2
.gitignore vendored
View file

@ -11,4 +11,4 @@ target/
.idea
Cargo.lock
lib*.a
/docs/_build
/docs/_build

View file

@ -24,109 +24,109 @@ test_unimplemented = []
## (common/core and Tier1) feature sets
# "feat_common_core" == baseline core set of utilities which can be built/run on most targets
feat_common_core = [
"base32",
"base64",
"basename",
"cat",
"cksum",
"comm",
"cp",
"cut",
"date",
"df",
"dircolors",
"dirname",
"echo",
"env",
"expand",
"expr",
"factor",
"false",
"fmt",
"fold",
"hashsum",
"head",
"join",
"link",
"ln",
"ls",
"mkdir",
"mktemp",
"more",
"mv",
"nl",
"od",
"paste",
"printenv",
"printf",
"ptx",
"pwd",
"readlink",
"realpath",
"relpath",
"rm",
"rmdir",
"seq",
"shred",
"shuf",
"sleep",
"sort",
"split",
"sum",
"tac",
"tail",
"tee",
"test",
"tr",
"true",
"truncate",
"tsort",
"unexpand",
"uniq",
"wc",
"yes",
"base32",
"base64",
"basename",
"cat",
"cksum",
"comm",
"cp",
"cut",
"date",
"df",
"dircolors",
"dirname",
"echo",
"env",
"expand",
"expr",
"factor",
"false",
"fmt",
"fold",
"hashsum",
"head",
"join",
"link",
"ln",
"ls",
"mkdir",
"mktemp",
"more",
"mv",
"nl",
"od",
"paste",
"printenv",
"printf",
"ptx",
"pwd",
"readlink",
"realpath",
"relpath",
"rm",
"rmdir",
"seq",
"shred",
"shuf",
"sleep",
"sort",
"split",
"sum",
"tac",
"tail",
"tee",
"test",
"tr",
"true",
"truncate",
"tsort",
"unexpand",
"uniq",
"wc",
"yes",
]
# "feat_Tier1" == expanded set of utilities which can be built/run on the usual rust "Tier 1" target platforms (ref: <https://forge.rust-lang.org/release/platform-support.html>)
feat_Tier1 = [
"feat_common_core",
#
"arch",
"hostname",
"nproc",
"sync",
"touch",
"whoami",
"feat_common_core",
#
"arch",
"hostname",
"nproc",
"sync",
"touch",
"whoami",
]
## (primary platforms) feature sets
# "feat_os_macos" == set of utilities which can be built/run on the MacOS platform
feat_os_macos = [
"feat_os_unix", ## == a modern/usual *nix platform
"feat_os_unix", ## == a modern/usual *nix platform
]
# "feat_os_unix" == set of utilities which can be built/run on modern/usual *nix platforms
feat_os_unix = [
"feat_Tier1",
#
"feat_require_crate_cpp",
"feat_require_unix",
"feat_require_unix_utmpx",
"feat_Tier1",
#
"feat_require_crate_cpp",
"feat_require_unix",
"feat_require_unix_utmpx",
]
# "feat_os_windows" == set of utilities which can be built/run on modern/usual windows platforms
feat_os_windows = [
"feat_Tier1", ## == "feat_os_windows_legacy" + "hostname"
]
"feat_Tier1", ## == "feat_os_windows_legacy" + "hostname"
]
## (secondary platforms) feature sets
# "feat_os_unix_gnueabihf" == set of utilities which can be built/run on the "arm-unknown-linux-gnueabihf" target (ARMv6 Linux [hardfloat])
feat_os_unix_gnueabihf = [
"feat_Tier1",
#
"feat_require_unix",
"feat_require_unix_utmpx",
"feat_Tier1",
#
"feat_require_unix",
"feat_require_unix_utmpx",
]
# "feat_os_unix_musl" == set of utilities which can be built/run on targets binding to the "musl" library (ref: <https://musl.libc.org/about.html>)
feat_os_unix_musl = [
"feat_Tier1",
#
"feat_require_unix",
"feat_Tier1",
#
"feat_require_unix",
]
## feature sets with requirements (restricting cross-platform availability)
#
@ -134,81 +134,81 @@ feat_os_unix_musl = [
#
# "feat_require_crate_cpp" == set of utilities requiring the `cpp` crate (which fail to compile on several platforms; as of 2020-04-23)
feat_require_crate_cpp = [
"stdbuf",
"stdbuf",
]
# "feat_require_unix" == set of utilities requiring support which is only available on unix platforms (as of 2020-04-23)
feat_require_unix = [
"chgrp",
"chmod",
"chown",
"chroot",
"du",
"groups",
"hostid",
"id",
"install",
"kill",
"logname",
"mkfifo",
"mknod",
"nice",
"numfmt",
"nohup",
"pathchk",
"stat",
"timeout",
"tty",
"uname",
"unlink",
"chgrp",
"chmod",
"chown",
"chroot",
"du",
"groups",
"hostid",
"id",
"install",
"kill",
"logname",
"mkfifo",
"mknod",
"nice",
"numfmt",
"nohup",
"pathchk",
"stat",
"timeout",
"tty",
"uname",
"unlink",
]
# "feat_require_unix_utmpx" == set of utilities requiring unix utmp/utmpx support
# * ref: <https://wiki.musl-libc.org/faq.html#Q:-Why-is-the-utmp/wtmp-functionality-only-implemented-as-stubs?>
feat_require_unix_utmpx = [
"pinky",
"uptime",
"users",
"who",
"pinky",
"uptime",
"users",
"who",
]
## (alternate/newer/smaller platforms) feature sets
# "feat_os_unix_fuchsia" == set of utilities which can be built/run on the "Fuchsia" OS (refs: <https://fuchsia.dev>; <https://en.wikipedia.org/wiki/Google_Fuchsia>)
feat_os_unix_fuchsia = [
"feat_common_core",
#
"feat_require_crate_cpp",
#
"chgrp",
"chmod",
"chown",
"du",
"groups",
"hostid",
"install",
"logname",
"mkfifo",
"mknod",
"nice",
"pathchk",
"tty",
"uname",
"unlink",
"feat_common_core",
#
"feat_require_crate_cpp",
#
"chgrp",
"chmod",
"chown",
"du",
"groups",
"hostid",
"install",
"logname",
"mkfifo",
"mknod",
"nice",
"pathchk",
"tty",
"uname",
"unlink",
]
# "feat_os_unix_redox" == set of utilities which can be built/run on "Redox OS" (refs: <https://www.redox-os.org>; <https://en.wikipedia.org/wiki/Redox_(operating_system)>)
feat_os_unix_redox = [
"feat_common_core",
#
"uname",
"chmod",
"install",
"feat_common_core",
#
"uname",
"chmod",
"install",
]
# "feat_os_windows_legacy" == slightly restricted set of utilities which can be built/run on early windows platforms (eg, "WinXP")
feat_os_windows_legacy = [
"feat_common_core",
#
"arch",
"nproc",
"sync",
"touch",
"whoami",
"feat_common_core",
#
"arch",
"nproc",
"sync",
"touch",
"whoami",
]
[workspace]

View file

@ -46,101 +46,101 @@ BUSYBOX_SRC := $(BUSYBOX_ROOT)/busybox-$(BUSYBOX_VER)
# Possible programs
PROGS := \
base32 \
base64 \
basename \
cat \
cksum \
comm \
cp \
cut \
df \
dircolors \
dirname \
echo \
env \
expand \
expr \
factor \
false \
fmt \
fold \
hashsum \
head \
join \
link \
ln \
ls \
mkdir \
mktemp \
more \
mv \
nl \
numfmt \
nproc \
od \
paste \
printenv \
printf \
ptx \
pwd \
readlink \
realpath \
relpath \
rm \
rmdir \
seq \
shred \
shuf \
sleep \
sort \
split \
sum \
sync \
tac \
tail \
tee \
test \
tr \
true \
truncate \
tsort \
unexpand \
uniq \
wc \
whoami \
yes
base32 \
base64 \
basename \
cat \
cksum \
comm \
cp \
cut \
df \
dircolors \
dirname \
echo \
env \
expand \
expr \
factor \
false \
fmt \
fold \
hashsum \
head \
join \
link \
ln \
ls \
mkdir \
mktemp \
more \
mv \
nl \
numfmt \
nproc \
od \
paste \
printenv \
printf \
ptx \
pwd \
readlink \
realpath \
relpath \
rm \
rmdir \
seq \
shred \
shuf \
sleep \
sort \
split \
sum \
sync \
tac \
tail \
tee \
test \
tr \
true \
truncate \
tsort \
unexpand \
uniq \
wc \
whoami \
yes
UNIX_PROGS := \
arch \
chgrp \
chmod \
chown \
chroot \
du \
groups \
hostid \
hostname \
id \
install \
kill \
logname \
mkfifo \
mknod \
nice \
nohup \
pathchk \
pinky \
stat \
stdbuf \
timeout \
touch \
tty \
uname \
unlink \
uptime \
users \
who
arch \
chgrp \
chmod \
chown \
chroot \
du \
groups \
hostid \
hostname \
id \
install \
kill \
logname \
mkfifo \
mknod \
nice \
nohup \
pathchk \
pinky \
stat \
stdbuf \
timeout \
touch \
tty \
uname \
unlink \
uptime \
users \
who
ifneq ($(OS),Windows_NT)
PROGS := $(PROGS) $(UNIX_PROGS)
@ -229,7 +229,7 @@ endef
# Output names
EXES := \
$(sort $(filter $(UTILS),$(filter-out $(SKIP_UTILS),$(PROGS))))
$(sort $(filter $(UTILS),$(filter-out $(SKIP_UTILS),$(PROGS))))
INSTALLEES := ${EXES}
ifeq (${MULTICALL}, y)

View file

@ -36,7 +36,7 @@ set_env CARGO_MAKE_CARGO_BUILD_TEST_FLAGS ""
# determine features
env_features = get_env CARGO_FEATURES
if is_empty "${env_features}"
env_features = get_env FEATURES
env_features = get_env FEATURES
end_if
if is_empty "${env_features}"
if eq "${CARGO_MAKE_RUST_TARGET_OS}" "macos"
@ -61,7 +61,7 @@ end_if
# set build flags from features
if not is_empty "${features}"
set_env CARGO_MAKE_VAR_BUILD_TEST_FEATURES "${features}"
set_env CARGO_MAKE_CARGO_BUILD_TEST_FLAGS "--features ${features}"
set_env CARGO_MAKE_CARGO_BUILD_TEST_FLAGS "--features ${features}"
end_if
# determine show-utils helper script
show_utils = set "util/show-utils.sh"
@ -96,7 +96,7 @@ description = "## *DEFAULT* Build (debug-mode) and test project"
category = "[project]"
dependencies = [
"action-build-debug",
"test-terse",
"test-terse",
]
##
@ -106,8 +106,8 @@ description = "## Build (release-mode) project"
category = "[project]"
dependencies = [
"core::pre-build",
"action-build-release",
"core::post-build",
"action-build-release",
"core::post-build",
]
[tasks.build-debug]
@ -122,8 +122,8 @@ description = "## Build (release-mode) project example(s); usage: `cargo make (b
category = "[project]"
dependencies = [
"core::pre-build",
"action-build-examples",
"core::post-build",
"action-build-examples",
"core::post-build",
]
[tasks.build-features]
@ -131,8 +131,8 @@ description = "## Build (with features; release-mode) project; usage: `cargo mak
category = "[project]"
dependencies = [
"core::pre-build",
"action-build-features",
"core::post-build",
"action-build-features",
"core::post-build",
]
[tasks.debug]
@ -185,8 +185,8 @@ description = "## Run project tests"
category = "[project]"
dependencies = [
"core::pre-test",
"core::test",
"core::post-test",
"core::test",
"core::post-test",
]
[tasks.test-terse]
@ -194,8 +194,8 @@ description = "## Run project tests (with terse/summary output)"
category = "[project]"
dependencies = [
"core::pre-test",
"action-test_quiet",
"core::post-test",
"action-test_quiet",
"core::post-test",
]
[tasks.uninstall]
@ -213,8 +213,8 @@ category = "[project]"
dependencies = [
"core::pre-build",
"action-determine-utils",
"action-build-utils",
"core::post-build",
"action-build-utils",
"core::post-build",
]
[tasks.uutil]

View file

@ -17,4 +17,4 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: GNUmakefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

View file

@ -5,7 +5,7 @@ pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build
@ -15,15 +15,15 @@ if "%1" == "" goto help
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%

View file

@ -1 +1 @@
target
target

View file

@ -128,10 +128,10 @@ Exit status is 0 if EXPRESSION is neither null nor 0, 1 if EXPRESSION is null
or 0, 2 if EXPRESSION is syntactically invalid, and 3 if an error occurred.
Environment variables:
* EXPR_DEBUG_TOKENS=1 dump expression's tokens
* EXPR_DEBUG_RPN=1 dump expression represented in reverse polish notation
* EXPR_DEBUG_SYA_STEP=1 dump each parser step
* EXPR_DEBUG_AST=1 dump expression represented abstract syntax tree"#
* EXPR_DEBUG_TOKENS=1 dump expression's tokens
* EXPR_DEBUG_RPN=1 dump expression represented in reverse polish notation
* EXPR_DEBUG_SYA_STEP=1 dump each parser step
* EXPR_DEBUG_AST=1 dump expression represented abstract syntax tree"#
);
}

View file

@ -331,19 +331,19 @@ pub fn uumain(args: Vec<String>) -> i32 {
auto accept optional single/two letter suffix:
1K = 1000, 1Ki = 1024, 1M = 1000000, 1Mi = 1048576,
1K = 1000, 1Ki = 1024, 1M = 1000000, 1Mi = 1048576,
si accept optional single letter suffix:
1K = 1000, 1M = 1000000, ...
1K = 1000, 1M = 1000000, ...
iec accept optional single letter suffix:
1K = 1024, 1M = 1048576, ...
1K = 1024, 1M = 1048576, ...
iec-i accept optional two-letter suffix:
1Ki = 1024, 1Mi = 1048576, ..."
1Ki = 1024, 1Mi = 1048576, ..."
);
return 0;

View file

@ -245,7 +245,7 @@ pub fn num_format(field: &FormatField, in_str_opt: Option<&String>) -> Option<St
// otherwise we'll interpret the argument as a number
// using the appropriate Formatter
let in_str = in_str_opt.expect(
"please send the devs this message:
"please send the devs this message:
\n get_provided is failing to ret as Some(0) on no str ");
// first get information about the beginning of the
// numeric argument that would be useful for