Changeset 86
- Timestamp:
- 04/18/2006 21:52:33 (6 years ago)
- File:
-
- 1 edited
-
confman/bash_completions (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
confman/bash_completions
r85 r86 41 41 cmds="help setup update commit diff status $fd_cmds $mod_cmds" 42 42 43 44 if [ `expr "${fd_cmds}" : ".*\(${prev}\).*"` ] ; then 45 COMPREPLY=( $(compgen -A directory -A file ${cur}) ) 46 return 0 43 if [ "${prev}" == "confman" -o "${prev}" == "help" ] ; then 44 COMPREPLY=($(compgen -W "${cmds}" -- ${cur})) 45 return 0 46 elif [ `expr "${fd_cmds}" : ".*\(${prev}\).*"` ] ; then 47 COMPREPLY=( $(compgen -A directory -A file ${cur}) ) 48 return 0 47 49 elif [ `expr "${mod_cmds}" : ".*\(${prev}\).*"` ] ; then 48 50 local modules=$(grep -vE '^#|^$' $RECIPE_PATH | tr '\n' ' ') … … 50 52 return 0 51 53 elif [ `expr "import ${fd_cmds}" : ".*\(${twoback}\).*"` ] ; then 52 COMPREPLY=($(compgen -A directory -A file ${cur})) 53 return 0 54 elif [ `expr rollback : ".*\(${twoback}\).*"` ] ; then 54 COMPREPLY=($(compgen -A directory -A file ${cur})) 55 return 0 56 elif [ `expr "${chkpt_cmds}" : ".*\(${twoback}\).*"` ] ; then 57 local module=${prev} 58 local checkpoints=$(confman checklook ${module}|tr '\n' ' ') 59 COMPREPLY=($(compgen -W "${checkpoints}" -- ${cur})) 60 return 0 61 elif [ `expr "rollback" : ".*\(${threeback}\).*"` ] ; then 62 local day=${prev:0:4}-${prev:4:2}-${prev:6:2} 63 local hoursmins=$(confman log |grep '^r[0-9][0-9]*' |\ 64 grep 2006-04-06|\ 65 sed 's/.*20[0-9][0-9]-[0-9][0-9]-[0-9][0-9] \([0-9][0-9]\):\([0-9][0-9]\).*/"\1\2"/'|\ 66 tr '\n' ' ') 67 COMPREPLY=($(compgen -W "${hoursmins}" -- ${cur})) 68 return 0 69 elif [ `expr "rollback" : ".*\(${twoback}\).*"` ] ; then 55 70 local module=${prev} 56 71 local checkpoints=$(confman checklook ${module}|tr '\n' ' ') … … 61 76 COMPREPLY=($(compgen -W "${checkpoints}" -- ${cur})) 62 77 return 0 63 elif [ `expr "${chkpt_cmds}" : ".*\(${twoback}\).*"` ] ; then64 local module=${prev}65 local checkpoints=$(confman checklook ${module}|tr '\n' ' ')66 COMPREPLY=($(compgen -W "${checkpoints}" -- ${cur}))67 return 068 elif [ `expr rollback : ".*\(${threeback}\).*"` ] ; then69 local day=${prev:0:4}-${prev:4:2}-${prev:6:2}70 local hoursmins=$(confman log |grep '^r[0-9][0-9]*' |\71 grep 2006-04-06|\72 sed 's/.*20[0-9][0-9]-[0-9][0-9]-[0-9][0-9] \([0-9][0-9]\):\([0-9][0-9]\).*/"\1\2"/'|\73 tr '\n' ' ')74 COMPREPLY=($(compgen -W "${hoursmins}" -- ${cur}))75 return 076 78 fi 77 79 78 COMPREPLY=($(compgen -W "${cmds}" -- ${cur}))79 80 return 0 80 81 } 81 complete -F _confman confman82 complete -F _confman -o filenames confman
Note: See TracChangeset
for help on using the changeset viewer.
