arkanum/arkanum-completion
OCram85 e700e7b477
All checks were successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/push/next Pipeline was successful
ci/woodpecker/push/deploy Pipeline was successful
Extends arkanum command and option structure (#62)
#### 📖 Summary

- adds nested arguments for arkanum:

```
arkanum <flag> COMMAND OPTION <ARGUMENT>
```

#### 📑 Test Plan

> 💡 Select your test plan for the code changes.

| Choice | Test Method       |
| :----: | :-----------      |
|      | CI pipeline tests |
|        | Custom test       |
|        | No test plan      |

##### Details / Justification

<!-- Add your test details or justification for missing tests here. -->

#### 📚 Additional Notes

- fixes #61

Co-authored-by: OCram85 <marco.blessing@googlemail.com>
Reviewed-on: CodeServer/arkanum#62
2023-08-03 09:51:02 +02:00

40 lines
1001 B
Bash

#!/bin/env bash
#complete -W "--disable-motd --install-extensions --reset-codesetting docker-cli dotnet gitea golang nodejs volta powershell -h" arkanum
function _command_completions() {
local cur prev
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
case ${COMP_CWORD} in
1)
# shellcheck disable=2207,SC2086
COMPREPLY=($(compgen -W "config git install help" -- ${cur}))
;;
2)
case ${prev} in
config)
# shellcheck disable=2207,SC2086
COMPREPLY=($(compgen -W "disable-motd install-extensions reset-codesettings" -- ${cur}))
;;
git)
# shellcheck disable=2207,SC2086
COMPREPLY=($(compgen -W "setup" -- ${cur}))
;;
install)
# shellcheck disable=2207,SC2086
COMPREPLY=($(compgen -W "docker-cli dotnet golang nodejs volta powershell gitea" -- ${cur}))
;;
help)
;;
esac
;;
*)
COMPREPLY=()
;;
esac
}
complete -F _command_completions arkanum