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