public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "André Erdmann" <dywi@mailerd.de>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/R_overlay:master commit in: files/misc/
Date: Fri,  9 Aug 2013 10:18:06 +0000 (UTC)	[thread overview]
Message-ID: <1376043298.e65b3e5e4dba9e1895fa48ad1acfa4098341ca24.dywi@gentoo> (raw)

commit:     e65b3e5e4dba9e1895fa48ad1acfa4098341ca24
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Fri Aug  9 10:14:58 2013 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Fri Aug  9 10:14:58 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=e65b3e5e

files/misc: bash completion for roverlay

---
 files/misc/roverlay.bashcomp | 116 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 116 insertions(+)

diff --git a/files/misc/roverlay.bashcomp b/files/misc/roverlay.bashcomp
new file mode 100644
index 0000000..2f18ee9
--- /dev/null
+++ b/files/misc/roverlay.bashcomp
@@ -0,0 +1,116 @@
+# R overlay -- bash completion for roverlay
+# -*- coding: utf-8 -*-
+
+_roverlay_comp() {
+   local cur
+   local prev
+
+   COMPREPLY=()
+   _get_comp_words_by_ref cur prev
+
+   local LONGOPTS=(
+      '--help' '--version'
+      '--config' '--field-definition' '--fdef' '--repo-config'
+      '--deprule-file' '--package-rules' '--overlay' '--overlay-name'
+      '--additions-dir'
+      '--write-overlay' '--write' '--no-write-overlay' '--no-write'
+      '--show-overlay' '--show' '--no-show-overlay' '--no-show'
+      '--strict-sync' '--sync' '--nosync' '--no-sync' '--sync-imports'
+      '--distroot' '--force-distroot' '--local-distdir' '--from'
+      '--incremental' '--no-incremental' '--fixup-category-move'
+      '--fixup-category-move-reverse' '--distmap-verify' '--revbump'
+      '--no-revbump' '--immediate-ebuild-writes' '--manifest' '--no-manifest'
+      '--manifest-implementation' '--target-uid' '--target-gid' '--pc'
+      '--print-config' '--ppr' '--print-package-rules'
+      '--help-config' '--list-config-entries' '--dump-file' '--strict'
+      '--stats' '--no-stats' '--dump-stats'
+   )
+
+   local SHORTOPTS=(
+      '-h' '-V' '-c' '-F' '-R' '-D' '-P' '-O' '-N' '-A' '-M'
+   )
+
+   local CMDARGS=(
+      'sync' 'create' 'depres' 'depres_console' 'nop' 'apply_rules'
+      'setupdirs'
+   )
+
+   local have_command=
+   local k
+   local first=y
+   for k in "${COMP_WORDS[@]}"; do
+      if [[ " ${CMDARGS[*]} " == *" ${k} "* ]] && [[ -z "${first}" ]]; then
+         have_command=y
+         break
+      fi
+      first=
+   done
+
+   case "${prev}" in
+      '-c'|'--config'|'-F'|'--field-definition'|'--fdef'|\
+      '-R'|'--repo-config')
+         # options with <file> arg
+         _filedir
+      ;;
+
+      '-O'|'--overlay'|'-A'|'--additions-dir'|'--distroot'|\
+      '--local-distdir'|'--from')
+      # options with <dir> arg
+         _filedir -d
+      ;;
+
+      '-D'|'--deprule-file'|'-P'|'--package-rules')
+         # options with <file|dir> arg
+         _filedir
+      ;;
+
+      '--dump-file')
+         # stdout or file
+         _filedir
+         [[ "${cur}" ]] || COMPREPLY+=( "-" )
+      ;;
+
+      '-M'|'--manifest-implementation')
+         COMPREPLY=( $(compgen -W "default next ebuild e" -- "${cur}" ) )
+      ;;
+
+      '--target-uid')
+         COMPREPLY=( $( compgen -u -- "${cur}" ) )
+         #_uids
+         #COMPREPLY+=
+      ;;
+
+      '--target-gid')
+         COMPREPLY=( $( compgen -g -- "${cur}" ) )
+         #_gids
+         #COMPREPLY+=
+      ;;
+
+
+      '-N'|'--overlay-name')
+         # options with str/unspecified arg
+         true
+      ;;
+
+      *)
+         case "${cur}" in
+            --*)
+               COMPREPLY=( $( compgen -W "${LONGOPTS[*]}" -- "${cur}" ) )
+            ;;
+            -*)
+               COMPREPLY=(
+                  $( compgen -W "${LONGOPTS[*]} ${SHORTOPTS[*]}" -- "${cur}" )
+               )
+            ;;
+            *)
+               local words="${LONGOPTS[*]} ${SHORTOPTS[*]}"
+               [[ "${have_command}" ]] || words+=" ${CMDARGS[*]}"
+               COMPREPLY=( $( compgen -W "${words}" -- "${cur}" ) )
+            ;;
+         esac
+
+      ;;
+   esac
+}
+
+complete -F _roverlay_comp roverlay


             reply	other threads:[~2013-08-09 10:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-09 10:18 André Erdmann [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-08-19 15:42 [gentoo-commits] proj/R_overlay:master commit in: files/misc/ André Erdmann
2013-09-13 16:19 André Erdmann
2013-09-23 15:30 André Erdmann
2014-02-22 15:15 André Erdmann
2014-04-01 16:38 André Erdmann
2014-07-18 16:20 André Erdmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1376043298.e65b3e5e4dba9e1895fa48ad1acfa4098341ca24.dywi@gentoo \
    --to=dywi@mailerd.de \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox