|
1 |
| -_exercism() { |
2 |
| - local curcontext="$curcontext" state line |
3 |
| - typeset -A opt_args |
| 1 | +#compdef exercism |
4 | 2 |
|
5 |
| - local -a options |
6 |
| - options=(configure:"Writes config values to a JSON file." |
7 |
| - download:"Downloads and saves a specified submission into the local system" |
8 |
| - open:"Opens a browser to exercism.io for the specified submission." |
9 |
| - submit:"Submits a new iteration to a problem on exercism.io." |
10 |
| - troubleshoot:"Outputs useful debug information." |
11 |
| - upgrade:"Upgrades to the latest available version." |
12 |
| - version:"Outputs version information." |
13 |
| - workspace:"Outputs the root directory for Exercism exercises." |
14 |
| - help:"Shows a list of commands or help for one command") |
| 3 | +local curcontext="$curcontext" state line |
| 4 | +typeset -A opt_args |
15 | 5 |
|
16 |
| - _arguments -s -S \ |
17 |
| - {-h,--help}"[show help]" \ |
18 |
| - {-t,--timeout}"[override default HTTP timeout]" \ |
19 |
| - {-v,--verbose}"[turn on verbose logging]" \ |
20 |
| - '(-): :->command' \ |
21 |
| - '(-)*:: :->option-or-argument' \ |
22 |
| - && return 0; |
| 6 | +local -a options |
| 7 | +options=(configure:"Writes config values to a JSON file." |
| 8 | + download:"Downloads and saves a specified submission into the local system" |
| 9 | + open:"Opens a browser to exercism.io for the specified submission." |
| 10 | + submit:"Submits a new iteration to a problem on exercism.io." |
| 11 | + troubleshoot:"Outputs useful debug information." |
| 12 | + upgrade:"Upgrades to the latest available version." |
| 13 | + version:"Outputs version information." |
| 14 | + workspace:"Outputs the root directory for Exercism exercises." |
| 15 | + help:"Shows a list of commands or help for one command") |
23 | 16 |
|
24 |
| - case $state in |
25 |
| - (command) |
26 |
| - _describe 'commands' options ;; |
27 |
| - (option-or-argument) |
28 |
| - case $words[1] in |
29 |
| - s*) |
30 |
| - _files |
31 |
| - ;; |
32 |
| - esac |
33 |
| - esac |
34 |
| -} |
| 17 | +_arguments -s -S \ |
| 18 | + {-h,--help}"[show help]" \ |
| 19 | + {-t,--timeout}"[override default HTTP timeout]" \ |
| 20 | + {-v,--verbose}"[turn on verbose logging]" \ |
| 21 | + '(-): :->command' \ |
| 22 | + '(-)*:: :->option-or-argument' \ |
| 23 | + && return 0; |
35 | 24 |
|
36 |
| -compdef '_exercism' exercism |
| 25 | +case $state in |
| 26 | + (command) |
| 27 | + _describe 'commands' options ;; |
| 28 | + (option-or-argument) |
| 29 | + case $words[1] in |
| 30 | + s*) |
| 31 | + _files |
| 32 | + ;; |
| 33 | + esac |
| 34 | +esac |
0 commit comments