diff --git a/TODO b/TODO index caa4105..622b3ab 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,3 @@ -- fix the 3 mode commands to use -m so completion works correctly - vnet ipv6 doesnt work anymore UPDATE: with auto_linklocal seems to work after some seconds - on reboot, no pf will be started diff --git a/src/completions.sh b/src/completions.sh index 2cc6723..45fd4d6 100644 --- a/src/completions.sh +++ b/src/completions.sh @@ -21,6 +21,15 @@ reply_version() { COMPREPLY=( $(compgen -W "${versions[*]}" -- "$cur") ) } +reply_rcscripts() { + local jail=${COMP_WORDS[2]} + local scripts=$(jaildk _get_rc_scripts $jail | sed 's|.*/||') + scripts=${scripts//$'\n'/ } + scripts=${scripts//$'\r'/} + echo "[jail=$jail] [cur=$cur] [scripts=${scripts[*]}]" > debug.log + COMPREPLY=( $(compgen -W "${scripts[*]}" -- "$cur") ) +} + functions='mount,ports,mtree,pf' modes='start,stop,status,restart' @@ -69,7 +78,7 @@ subcmd_opts_status=(-v) subcmd_args_status=@jail ### sub cmd rc -subcmd_opts_rc=(-m:$modes -r) +subcmd_opts_rc=(-m:$modes -r:@rcscripts) subcmd_args_rc=@jail ### sub cmd ipfw