Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
snf-ganeti
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
itminedu
snf-ganeti
Commits
c1439c1c
Commit
c1439c1c
authored
13 years ago
by
Apollon Oikonomopoulos
Browse files
Options
Downloads
Patches
Plain Diff
Make bash completion network-aware
Signed-off-by:
Apollon Oikonomopoulos
<
apollon@noc.grnet.gr
>
parent
2d25bcdf
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
autotools/build-bash-completion
+13
-0
13 additions, 0 deletions
autotools/build-bash-completion
with
13 additions
and
0 deletions
autotools/build-bash-completion
+
13
−
0
View file @
c1439c1c
...
...
@@ -126,6 +126,15 @@ def WritePreamble(sw):
sw
.
DecIndent
()
sw
.
Write
(
"
}
"
)
sw
.
Write
(
"
_ganeti_network() {
"
)
sw
.
IncIndent
()
try
:
networks_path
=
os
.
path
.
join
(
constants
.
DATA_DIR
,
"
ssconf_networks
"
)
sw
.
Write
(
"
cat %s 2>/dev/null || :
"
,
utils
.
ShellQuote
(
networks_path
))
finally
:
sw
.
DecIndent
()
sw
.
Write
(
"
}
"
)
# Params: <offset> <options with values> <options without values>
# Result variable: $first_arg_idx
sw
.
Write
(
"
_ganeti_find_first_arg() {
"
)
...
...
@@ -339,6 +348,8 @@ class CompletionWriter:
WriteCompReply
(
sw
,
"
-W
\"
$(_ganeti_iallocator)
\"
"
,
cur
=
cur
)
elif
suggest
==
cli
.
OPT_COMPL_ONE_NODEGROUP
:
WriteCompReply
(
sw
,
"
-W
\"
$(_ganeti_nodegroup)
\"
"
,
cur
=
cur
)
elif
suggest
==
cli
.
OPT_COMPL_ONE_NETWORK
:
WriteCompReply
(
sw
,
"
-W
\"
$(_ganeti_network)
\"
"
,
cur
=
cur
)
elif
suggest
==
cli
.
OPT_COMPL_INST_ADD_NODES
:
sw
.
Write
(
"
local tmp= node1= pfx= curvalue=
\"
${optcur#*:}
\"
"
)
...
...
@@ -440,6 +451,8 @@ class CompletionWriter:
choices
=
"
$(_ganeti_nodes)
"
elif
isinstance
(
arg
,
cli
.
ArgGroup
):
choices
=
"
$(_ganeti_nodegroup)
"
elif
isinstance
(
arg
,
cli
.
ArgNetwork
):
choices
=
"
$(_ganeti_network)
"
elif
isinstance
(
arg
,
cli
.
ArgJobId
):
choices
=
"
$(_ganeti_jobs)
"
elif
isinstance
(
arg
,
cli
.
ArgOs
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment