diff options
Diffstat (limited to 'share/functions/__fish_is_first_token.fish')
-rw-r--r-- | share/functions/__fish_is_first_token.fish | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/share/functions/__fish_is_first_token.fish b/share/functions/__fish_is_first_token.fish new file mode 100644 index 00000000..e2ca69b1 --- /dev/null +++ b/share/functions/__fish_is_first_token.fish @@ -0,0 +1,15 @@ + +function __fish_is_first_token -d 'Test if no non-switch argument has been specified yet' + set -- cmd (commandline -poc) + set -e -- cmd[1] + for i in $cmd + switch $i + case '-*' + + case '*' + return 1; + end + end + return 0 +end + |