Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
f742baf7
Unverified
Commit
f742baf7
authored
May 23, 2020
by
Renato dos Santos
Committed by
GitHub
May 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add plugin for LXD autocomplete (#7457)
parent
6b5c8728
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
README.md
plugins/lxd/README.md
+9
-0
lxd.plugin.zsh
plugins/lxd/lxd.plugin.zsh
+26
-0
No files found.
plugins/lxd/README.md
0 → 100644
View file @
f742baf7
# lxd
This plugin provides completion for
[
lxd
](
https://linuxcontainers.org/lxd/
)
, as well as aliases
for frequent lxc commands.
To use it add
`lxd`
to the plugins array in your zshrc file.
```
zsh
plugins=(... lxd)
plugins/lxd/lxd.plugin.zsh
0 → 100644
View file @
f742baf7
_lxc_get_command_list
()
{
$_comp_command1
|
sed
"1,/Available Commands/d"
|
awk
'/^[ \t]*[a-z]+/ { print $1 }'
}
_lxc_get_subcommand_list
()
{
$_comp_command1
${
words
[2]
}
|
sed
"1,/Available Commands/d"
|
awk
'/^[ \t]*[a-z]+/ { print $1 }'
}
_lxc
()
{
local
curcontext
=
"
$curcontext
"
state line
typeset
-A
opt_args
_arguments
\
'1: :->command'
\
'*: :->args'
case
$state
in
command
)
compadd
$(
_lxc_get_command_list
)
;;
*
)
compadd
$(
_lxc_get_subcommand_list
)
;;
esac
}
compdef _lxc lxc
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment