-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sudo prompts are no longer excessively noisey
- consistent clean outputs - echo-lines: - support variable columns - eval-helper: - support title option - output wrapping information to tty, such that stdout is useful - sudo-helper: - support quiet, wrap, and confirm options - sudo commands are output in yellow when wrapping - fs-own: readable path outputs - setup-git: consistent coloring - setup-node, setup-util-node: consistent coloring and version displays - setup-dns: remove unused quiet option - service-helper: fixed typos in reasons /ref f0afd9d
- Loading branch information
Showing
21 changed files
with
647 additions
and
301 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/env bash | ||
|
||
function is_shapeshifter() ( | ||
source "$DOROTHY/sources/stdinargs.bash" | ||
|
||
# ===================================== | ||
# Arguments | ||
|
||
function help { | ||
cat <<-EOF >/dev/stderr | ||
ABOUT: | ||
Checks whether the <input> is a shapeshifter (something that outputs TTY control sequences) | ||
USAGE: | ||
is-shapeshifter [...options] [--] ...<input> | ||
echo-lines ...<input> | is-shapeshifter [...options] | ||
OPTIONS: | ||
$(stdinargs_options_help --) | ||
EOF | ||
if test "$#" -ne 0; then | ||
echo-error "$@" | ||
fi | ||
return 22 # EINVAL 22 Invalid argument | ||
} | ||
|
||
# ===================================== | ||
# Action | ||
|
||
local found='no' | ||
function on_input { | ||
local line="$1" | ||
# regexp should match [echo-clear-lines] [echo-revolving-door] [is-shapeshifter] | ||
if [[ $line =~ $'\e\[[0-9]*[AKGFJ]' ]]; then | ||
found='yes' | ||
return 210 # ECUSTOM 210 Processing complete, exit early | ||
fi | ||
} | ||
function on_finish { | ||
test "$found" = 'yes' | ||
} | ||
|
||
stdinargs "$@" | ||
) | ||
|
||
# fire if invoked standalone | ||
if test "$0" = "${BASH_SOURCE[0]}"; then | ||
is_shapeshifter "$@" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.