From 06dae018ff0b41bc6140a603f5cbf2b54b2fd3ae Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 17 Dec 2018 15:10:18 +1300 Subject: Use `command` consistently, silence ShellCheck ShellCheck (SC2164) is upset about these `cd` commands where the return type isn't being checked, but they're all by design, as they're the last command in the function, and thereby constitute the function's return value implicitly. Otherwise, this commit changes the shrc.d and profile.d subfiles to use the `command` wrapper only where it's actually needed. --- sh/profile.d/options.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sh/profile.d/options.sh') diff --git a/sh/profile.d/options.sh b/sh/profile.d/options.sh index 58376fb3..c60dd140 100644 --- a/sh/profile.d/options.sh +++ b/sh/profile.d/options.sh @@ -13,7 +13,7 @@ options() { [ -d "$dir" ] && return # Create the directory and step into it - command -p mkdir -p -- "$dir" || return + mkdir -p -- "$dir" || return cd -- "$dir" || return # Write the program's --help output to a file, even if it's empty @@ -23,7 +23,7 @@ options() { # Iterate through remaining arguments (desired options), creating files to # show they're available if found in the help output for opt do - command -p grep -q -- \ + command grep -q -- \ '[^[:alnum:]]--'"$opt"'[^[:alnum:]]' help || continue touch -- "$opt" done -- cgit v1.2.3