-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix [dorothy edit] with vscode by adding support for [edit --only-edi…
…tor] also rename beta command [get-nonflags] to [echo-nonflags] but it was not suitable, so still beta
- Loading branch information
Showing
4 changed files
with
68 additions
and
61 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,52 @@ | ||
#!/usr/bin/env bash | ||
|
||
function echo_nonflags() ( | ||
source "$DOROTHY/sources/bash.bash" | ||
|
||
function help { | ||
cat <<-EOF >/dev/stderr | ||
ABOUT: | ||
Output all arguments that aren't flags. | ||
USAGE: | ||
echo-nonflags <...input> | ||
echo-lines <...input> | echo-nonflags | ||
EXAMPLE: | ||
echo-nonflags code -a --b c | ||
code | ||
c | ||
# exit status: 0 | ||
echo-lines code -a --b c | echo-nonflags | ||
code | ||
c | ||
# exit status: 0 | ||
QUIRKS: | ||
[edit --dry | echo-nonflags] will output [code -w -n] because of the following: | ||
echo 'code -a --b c' | echo-nonflags | ||
code -a --b c | ||
# exit status: 0 | ||
EOF | ||
return 22 # EINVAL 22 Invalid argument | ||
} | ||
|
||
function on_input { | ||
if [[ $1 != -* ]]; then | ||
print_line "$1" | ||
fi | ||
} | ||
source "$DOROTHY/sources/stdinargs.bash" | ||
) | ||
|
||
# fire if invoked standalone | ||
if test "$0" = "${BASH_SOURCE[0]}"; then | ||
echo_nonflags "$@" | ||
fi |
This file was deleted.
Oops, something went wrong.
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