OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

150 lines
3.3 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/*/bashcompletion/rock-tools
  9. # Copyright (C) 1998 - 2004 Clifford Wolf
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2 of the License, or
  14. # (at your option) any later version. A copy of the GNU General Public
  15. # License can be found at Documentation/COPYING.
  16. #
  17. # Many people helped and are helping developing ROCK Linux. Please
  18. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  19. # file for details.
  20. #
  21. # --- ROCK-COPYRIGHT-NOTE-END ---
  22. _interfaces() {
  23. COMPREPLY=( $( compgen -W "$( command \
  24. sed -ne 's|^interface \([^ ]\+\).*$|\1|p' \
  25. /etc/network/config )" -- $cur ) )
  26. }
  27. _mine_installed_packages() {
  28. COMPREPLY=( $( compgen -W "`(cd /var/adm/packages; echo *)`" -- $cur ) )
  29. }
  30. _mine() {
  31. local cur prev
  32. COMPREPLY=()
  33. cur=${COMP_WORDS[COMP_CWORD]}
  34. prev=${COMP_WORDS[COMP_CWORD-1]}
  35. if [ $COMP_CWORD -eq 1 ]; then
  36. case "$cur" in
  37. *)
  38. COMPREPLY=( $( compgen -W '-i -r -q -p -l -m -c -d -k -C -T' \
  39. -- $cur ) )
  40. ;;
  41. esac
  42. return 0
  43. fi
  44. case "$prev" in
  45. -R)
  46. _filedir -d
  47. return 0
  48. ;;
  49. -k)
  50. COMPREPLY=( $( compgen -W 'pkg_name pkg_version pkg_tarbz2 \
  51. pkg_config packages flists md5sums cksums \
  52. dependencies descs creator COPY I TITLE T \
  53. TEXT U URL A AUTHOR M MAINTAINER C CATEGORY \
  54. F FLAG R ARCH ARCHITECTURE E DEP DEPENDENCY \
  55. L LICENSE S STATUS V VER VERSION P PRI \
  56. PRIORITY CV-URL CV-PAT CV-DEL O CONF D DOWN \
  57. DOWNLOAD SRC SOURCEPACKAGE' -- $cur ) )
  58. return 0
  59. esac
  60. case "${COMP_WORDS[1]}" in
  61. -i)
  62. if [[ "$cur" == -* ]]; then
  63. COMPREPLY=( $( compgen -W '-t -v -f -R' -- $cur ) )
  64. else
  65. _filedir 'gem'
  66. fi
  67. ;;
  68. -r)
  69. if [[ "$cur" == -* ]]; then
  70. COMPREPLY=( $( compgen -W '-t -v -f -R' -- $cur ) )
  71. else
  72. _mine_installed_packages
  73. fi
  74. ;;
  75. -[qplmcd])
  76. if [[ "$cur" == -* ]]; then
  77. COMPREPLY=( $( compgen -W '-h -H' -- $cur ) )
  78. else
  79. _mine_installed_packages
  80. _filedir 'gem'
  81. fi
  82. ;;
  83. -k)
  84. if [[ "$cur" == -* ]]; then
  85. COMPREPLY=( $( compgen -W '-h -H' -- $cur ) )
  86. else
  87. _filedir 'gem'
  88. fi
  89. ;;
  90. -C)
  91. case "$COMP_CWORD" in
  92. 2)
  93. _filedir -d
  94. ;;
  95. 3)
  96. _filedir 'tar.bz2'
  97. ;;
  98. 4)
  99. _mine_installed_packages
  100. ;;
  101. esac
  102. ;;
  103. -T)
  104. case "$COMP_CWORD" in
  105. 2|3)
  106. _filedir -d
  107. ;;
  108. 4)
  109. _mine_installed_packages
  110. ;;
  111. esac
  112. esac
  113. return 0
  114. }
  115. complete -F _mine $filenames mine
  116. _rc()
  117. {
  118. COMPREPLY=()
  119. cur=${COMP_WORDS[COMP_CWORD]}
  120. prev=${COMP_WORDS[COMP_CWORD-1]}
  121. if [ $COMP_CWORD -eq 1 ]; then
  122. #first parameter on line
  123. if [ -r /etc/rc.d/init.d ]; then
  124. COMPREPLY=( $( compgen -W "`(cd /etc/rc.d/init.d; echo *)`" \
  125. -- $cur ) )
  126. fi
  127. return 0
  128. fi
  129. if [ $COMP_CWORD -eq 2 ]; then
  130. #second parameter on line
  131. COMPREPLY=( $( compgen -W "$( command rc $prev help | \
  132. cut -d{ -f2 | tr -d '{}|' )" \
  133. -- $cur ) )
  134. return 0
  135. fi
  136. }
  137. complete -F _rc $filenames rc