Last active
December 9, 2016 06:43
-
-
Save colstrom/ee00c70aedf10bdf8b24764a003dce75 to your computer and use it in GitHub Desktop.
empty.fish: sugar for test with less surprising results
This file contains hidden or 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
| function empty | |
| switch (count $argv) | |
| case 0 | |
| true | |
| case '*' | |
| for string in $argv | |
| test -z "$string" | |
| and return (true) | |
| end | |
| end | |
| end |
This file contains hidden or 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
| name = empty | |
| author = Chris Olstrom | |
| license = MIT | |
| provides = fish/functions/empty | |
| requires | |
| fish/builtin/and | |
| fish/builtin/case | |
| fish/builtin/count | |
| fish/builtin/end | |
| fish/builtin/for | |
| fish/builtin/function | |
| fish/builtin/return | |
| fish/builtin/string | |
| fish/builtin/switch | |
| fish/builtin/test | |
| fish/builtin/true | |
| fish/functions/empty |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment