mirror of
https://github.com/spf13/cobra
synced 2025-05-06 05:17:21 +00:00
add documentation for bash alias
This commit is contained in:
parent
bbb85f0691
commit
e149968eaf
1 changed files with 14 additions and 0 deletions
|
@ -204,3 +204,17 @@ __kubectl_get_namespaces()
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
# Using bash aliases for commands
|
||||||
|
|
||||||
|
You can also configure the `bash aliases` for the commands and they will also support completions.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
alias aliasname=origcommand
|
||||||
|
complete -o default -F __start_origcommand aliasname
|
||||||
|
|
||||||
|
# and now when you run `aliasname` completion will make
|
||||||
|
# suggestions as it did for `origcommand`.
|
||||||
|
|
||||||
|
$) aliasname <tab><tab>
|
||||||
|
completion firstcommand secondcommand
|
||||||
|
```
|
||||||
|
|
Loading…
Add table
Reference in a new issue