Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
nni
Commits
97b258b0
Unverified
Commit
97b258b0
authored
Dec 10, 2019
by
liuzhe-lz
Committed by
GitHub
Dec 10, 2019
Browse files
Fix bash completion bugs (#1838)
parent
522f847b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
tools/bash-completion
tools/bash-completion
+9
-4
No files found.
tools/bash-completion
View file @
97b258b0
# list of commands/arguments
__nnictl_cmds="create resume update stop trial experiment platform import export webui config log package tensorboard top"
__nnictl_cmds="create resume
view
update stop trial experiment platform import export webui config log package tensorboard top"
__nnictl_create_cmds="--config --port --debug"
__nnictl_resume_cmds="--port --debug"
__nnictl_view_cmds="--port"
__nnictl_update_cmds="searchspace concurrency duration trialnum"
__nnictl_update_searchspace_cmds="--filename"
__nnictl_update_concurrency_cmds="--value"
...
...
@@ -31,7 +32,7 @@ __nnictl_tensorboard_start_cmds="--trial_id --port"
__nnictl_top_cmds="--time"
# list of commands that accept an experiment ID as second argument
__nnictl_2
st
_expid_cmds=" resume stop import export "
__nnictl_2
nd
_expid_cmds=" resume
view
stop import export "
# list of commands that accept an experiment ID as third argument
__nnictl_3rd_expid_cmds=" update trial experiment webui config log tensorboard "
...
...
@@ -73,7 +74,7 @@ _nnictl()
COMPREPLY=($(compgen -W "${!args}" -- "${COMP_WORDS[2]}"))
# add experiment IDs to candidates if desired
if [[
" resume stop import export "
=~ " ${COMP_WORDS[1]} " ]]; then
if [[
$__nnictl_2nd_expid_cmds
=~ " ${COMP_WORDS[1]} " ]]; then
local experiments=$(ls ~/nni/experiments 2>/dev/null)
COMPREPLY+=($(compgen -W "$experiments" -- $cur))
fi
...
...
@@ -138,4 +139,8 @@ _nnictl()
fi
}
complete -o nosort -F _nnictl nnictl
if [[ ${BASH_VERSINFO[0]} -le 4 && ${BASH_VERSINFO[1]} -le 4 ]]; then
complete -F _nnictl nnictl
else
complete -o nosort -F _nnictl nnictl
fi
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