Last active
December 9, 2016 06:51
-
-
Save colstrom/9228b274d9ee708e4a0a5f97fde1ac44 to your computer and use it in GitHub Desktop.
downcase.fish: converts strings to lowercase
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 downcase | |
| if isatty stdin | |
| switch (count $argv) | |
| case 0 | |
| echo 'usage: downcase <string> [string ...]' | |
| return 100 | |
| case '*' | |
| list $argv | downcase | |
| end | |
| else | |
| while read string | |
| echo $string | tr [:upper:] [:lower:] | |
| 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 = downcase | |
| author = Chris Olstrom | |
| license = MIT | |
| provides = fish/functions/downcase | |
| requires | |
| command/tr | |
| fish/builtin/case | |
| fish/builtin/count | |
| fish/builtin/echo | |
| fish/builtin/else | |
| fish/builtin/end | |
| fish/builtin/function | |
| fish/builtin/if | |
| fish/builtin/read | |
| fish/builtin/return | |
| fish/builtin/string | |
| fish/builtin/switch | |
| fish/builtin/while | |
| fish/functions/downcase | |
| fish/functions/isatty | |
| fish/functions/list |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment