* [maintainer-tools PATCH 1/8] completion: require bash completion package and use it
@ 2016-02-18 16:20 Jani Nikula
2016-02-18 16:20 ` [maintainer-tools PATCH 2/8] dim: add list-branches subcommand to list nightly branches Jani Nikula
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: Jani Nikula @ 2016-02-18 16:20 UTC (permalink / raw)
To: intel-gfx; +Cc: jani.nikula
The bash completion package makes life a whole lot easier than using the
builtin bash completion features. It's quite likely anyone using
completion in bash already has it installed.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
bash_completion | 62 ++++++++++++++++++++++++++++++++-------------------------
1 file changed, 35 insertions(+), 27 deletions(-)
diff --git a/bash_completion b/bash_completion
index e44e5fc844b4..6a3a88cc80f8 100644
--- a/bash_completion
+++ b/bash_completion
@@ -11,7 +11,21 @@ dim ()
_dim ()
{
- local cur cmds opts i
+ local args arg cur prev words cword split
+ local cmds
+
+ # require bash-completion with _init_completion
+ type -t _init_completion >/dev/null 2>&1 || return
+
+ _init_completion || return
+
+ COMPREPLY=()
+
+ # arg = subcommand
+ _get_first_arg
+
+ # args = number of arguments
+ _count_args
if [ -f ~/linux/drm-intel-rerere/nightly.conf ] ; then
local nightly_branches=`(source ~/linux/drm-intel-rerere/nightly.conf ; echo $nightly_branches) | \
@@ -35,27 +49,21 @@ _dim ()
cmds="$cmds create-branch remove-branch create-workdir for-each-workdirs fw"
cmds="$cmds tag-next checker"
- opts="-d -f -i"
-
- i=1
-
- COMPREPLY=() # Array variable storing the possible completions.
- cur=${COMP_WORDS[COMP_CWORD]}
-
- for comp in "${COMP_WORDS[@]}" ; do
- for opt in $opts ; do
- if [[ $opt = $comp ]] ; then
- i=$((i+1))
- fi
- done
- done
-
- if [[ $COMP_CWORD == "$i" ]] ; then
- COMPREPLY=( $( compgen -W "$cmds $opts" -- $cur ) )
+ if [ -z "${arg}" ]; then
+ # top level completion
+ case "${cur}" in
+ -*)
+ local opts="-d -f -i"
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ ;;
+ *)
+ COMPREPLY=( $(compgen -W "${cmds}" -- ${cur}) )
+ ;;
+ esac
return 0
fi
- case "${COMP_WORDS[i]}" in
+ case "${arg}" in
push-branch)
COMPREPLY=( $( compgen -W "-f $nightly_branches" -- $cur ) )
;;
@@ -69,7 +77,7 @@ _dim ()
COMPREPLY=( $( compgen -W "-s" -- $cur ) )
;;
magic-patch|mp)
- if [[ $COMP_CWORD == "$((i+1))" ]] ; then
+ if [[ $args == 2 ]]; then
COMPREPLY=( $( compgen -o nospace -W "-a" -- $cur ) )
fi
;;
@@ -80,34 +88,34 @@ _dim ()
# FIXME needs a git sha1
;;
pull-request)
- if [[ $COMP_CWORD == "$((i+1))" ]] ; then
+ if [[ $args == 2 ]]; then
COMPREPLY=( $( compgen -W "$nightly_branches" -- $cur ) )
- elif [[ $COMP_CWORD == "$((i+2))" ]] ; then
+ elif [[ $args == 3 ]]; then
COMPREPLY=( $( compgen -W "$upstream_branches" -- $cur ) )
fi
;;
pull-request-next|pull-request-fixes|pull-request-next-fixes)
- if [[ $COMP_CWORD == "$((i+1))" ]] ; then
+ if [[ $args == 2 ]]; then
COMPREPLY=( $( compgen -W "$upstream_branches" -- $cur ) )
fi
;;
create-branch)
- if [[ $COMP_CWORD == "$((i+1))" ]] ; then
+ if [[ $args == 2 ]]; then
COMPREPLY=( $( compgen -o nospace -W "drm- topic/" -- $cur ) )
fi
;;
checkout|co)
- if [[ $COMP_CWORD == "$((i+1))" ]] ; then
+ if [[ $args == 2 ]]; then
COMPREPLY=( $( compgen -W "$nightly_branches" -- $cur ) )
fi
;;
remove-branch)
- if [[ $COMP_CWORD == "$((i+1))" ]] ; then
+ if [[ $args == 2 ]]; then
COMPREPLY=( $( compgen -W "$nightly_branches" -- $cur ) )
fi
;;
create-workdir)
- if [[ $COMP_CWORD == "$((i+1))" ]] ; then
+ if [[ $args == 2 ]]; then
COMPREPLY=( $( compgen -W "$nightly_branches all" -- $cur ) )
fi
;;
--
2.1.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [maintainer-tools PATCH 2/8] dim: add list-branches subcommand to list nightly branches
2016-02-18 16:20 [maintainer-tools PATCH 1/8] completion: require bash completion package and use it Jani Nikula
@ 2016-02-18 16:20 ` Jani Nikula
2016-02-18 16:20 ` [maintainer-tools PATCH 3/8] dim: add list-upstreams subcommand to list upstream branches Jani Nikula
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Jani Nikula @ 2016-02-18 16:20 UTC (permalink / raw)
To: intel-gfx; +Cc: jani.nikula
Helper for bash completion. Where to get the information depends on
user's dim configuration.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
dim | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/dim b/dim
index c004bc75ca06..33ef8288a291 100755
--- a/dim
+++ b/dim
@@ -972,6 +972,12 @@ function dim_pull_request_next_fixes
dim_pull_request drm-intel-next-fixes $upstream
}
+# Note: used by bash completion
+function dim_list_branches
+{
+ echo $dim_branches | sed 's/ /\n/g'
+}
+
dim_alias_ub=update-branches
function dim_update_branches
{
--
2.1.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [maintainer-tools PATCH 3/8] dim: add list-upstreams subcommand to list upstream branches
2016-02-18 16:20 [maintainer-tools PATCH 1/8] completion: require bash completion package and use it Jani Nikula
2016-02-18 16:20 ` [maintainer-tools PATCH 2/8] dim: add list-branches subcommand to list nightly branches Jani Nikula
@ 2016-02-18 16:20 ` Jani Nikula
2016-02-18 16:20 ` [maintainer-tools PATCH 4/8] completion: use the dim helpers to complete nightly and " Jani Nikula
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Jani Nikula @ 2016-02-18 16:20 UTC (permalink / raw)
To: intel-gfx; +Cc: jani.nikula
Helper for bash completion. The result depends on user's dim
configuration.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
dim | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/dim b/dim
index 33ef8288a291..6fb496ea4192 100755
--- a/dim
+++ b/dim
@@ -973,6 +973,14 @@ function dim_pull_request_next_fixes
}
# Note: used by bash completion
+function dim_list_upstreams
+{
+ echo origin/master
+ echo $DIM_DRM_UPSTREAM_REMOTE/drm-next
+ echo $DIM_DRM_UPSTREAM_REMOTE/drm-fixes
+}
+
+# Note: used by bash completion
function dim_list_branches
{
echo $dim_branches | sed 's/ /\n/g'
--
2.1.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [maintainer-tools PATCH 4/8] completion: use the dim helpers to complete nightly and upstream branches
2016-02-18 16:20 [maintainer-tools PATCH 1/8] completion: require bash completion package and use it Jani Nikula
2016-02-18 16:20 ` [maintainer-tools PATCH 2/8] dim: add list-branches subcommand to list nightly branches Jani Nikula
2016-02-18 16:20 ` [maintainer-tools PATCH 3/8] dim: add list-upstreams subcommand to list upstream branches Jani Nikula
@ 2016-02-18 16:20 ` Jani Nikula
2016-02-18 16:20 ` [maintainer-tools PATCH 5/8] dim: add list-commands subcommand to list all subcommands Jani Nikula
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Jani Nikula @ 2016-02-18 16:20 UTC (permalink / raw)
To: intel-gfx; +Cc: jani.nikula
Use the user's configured directories and remotes via dim.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
bash_completion | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/bash_completion b/bash_completion
index 6a3a88cc80f8..f89764e3947d 100644
--- a/bash_completion
+++ b/bash_completion
@@ -27,13 +27,8 @@ _dim ()
# args = number of arguments
_count_args
- if [ -f ~/linux/drm-intel-rerere/nightly.conf ] ; then
- local nightly_branches=`(source ~/linux/drm-intel-rerere/nightly.conf ; echo $nightly_branches) | \
- xargs -n 1 echo | grep '^origin' | sed -e 's/^origin\///'`
- else
- local nightly_branches=""
- fi
- local upstream_branches="origin/master airlied/drm-next airlied/drm-fixes"
+ local nightly_branches="$(dim list-branches)"
+ local upstream_branches="$(dim list-upstreams)"
cmds="setup nightly-forget update-branches"
cmds="$cmds rebuild-nightly cat-to-fixup"
--
2.1.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [maintainer-tools PATCH 5/8] dim: add list-commands subcommand to list all subcommands
2016-02-18 16:20 [maintainer-tools PATCH 1/8] completion: require bash completion package and use it Jani Nikula
` (2 preceding siblings ...)
2016-02-18 16:20 ` [maintainer-tools PATCH 4/8] completion: use the dim helpers to complete nightly and " Jani Nikula
@ 2016-02-18 16:20 ` Jani Nikula
2016-02-18 16:20 ` [maintainer-tools PATCH 6/8] dim: rename alias subcommand to list-aliases Jani Nikula
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Jani Nikula @ 2016-02-18 16:20 UTC (permalink / raw)
To: intel-gfx; +Cc: jani.nikula
Helper for completion.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
dim | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/dim b/dim
index 6fb496ea4192..2f6e6151a4b2 100755
--- a/dim
+++ b/dim
@@ -1115,6 +1115,12 @@ function assert_branch
fi
}
+# Note: used by bash completion
+function dim_list_commands
+{
+ declare -F | grep -o " dim_[a-zA-Z_]*" | sed 's/^ dim_//;s/_/-/g'
+}
+
function dim_alias
{
# use posix mode to omit functions in set output
@@ -1178,7 +1184,7 @@ function dim_usage
echo "usage: $0 [OPTIONS] SUBCOMMAND [ARGUMENTS]"
echo
echo "The available subcommands are:"
- declare -F | grep -o " dim_[a-zA-Z_]*" | sed 's/^ dim_/\t/'
+ dim_list_commands | sed 's/^/\t/'
echo
echo "See '$0 help' for more information."
}
--
2.1.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [maintainer-tools PATCH 6/8] dim: rename alias subcommand to list-aliases
2016-02-18 16:20 [maintainer-tools PATCH 1/8] completion: require bash completion package and use it Jani Nikula
` (3 preceding siblings ...)
2016-02-18 16:20 ` [maintainer-tools PATCH 5/8] dim: add list-commands subcommand to list all subcommands Jani Nikula
@ 2016-02-18 16:20 ` Jani Nikula
2016-02-18 16:20 ` [maintainer-tools PATCH 7/8] completion: use the dim helpers to complete subcommands and aliases Jani Nikula
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Jani Nikula @ 2016-02-18 16:20 UTC (permalink / raw)
To: intel-gfx; +Cc: jani.nikula
Also drop leading tab and fix underscores in output. Helper for bash
completion.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
dim | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dim b/dim
index 2f6e6151a4b2..1addd6f6a0e9 100755
--- a/dim
+++ b/dim
@@ -1121,11 +1121,12 @@ function dim_list_commands
declare -F | grep -o " dim_[a-zA-Z_]*" | sed 's/^ dim_//;s/_/-/g'
}
-function dim_alias
+# Note: used by bash completion
+function dim_list_aliases
{
# use posix mode to omit functions in set output
( set -o posix; set ) | grep "^dim_alias_[a-zA-Z0-9_]*=" |\
- sed 's/^dim_alias_/\t/;s/=/\t/'
+ sed 's/^dim_alias_//;s/=/\t/;s/_/-/g'
}
function dim_cat_to_fixup
--
2.1.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [maintainer-tools PATCH 7/8] completion: use the dim helpers to complete subcommands and aliases
2016-02-18 16:20 [maintainer-tools PATCH 1/8] completion: require bash completion package and use it Jani Nikula
` (4 preceding siblings ...)
2016-02-18 16:20 ` [maintainer-tools PATCH 6/8] dim: rename alias subcommand to list-aliases Jani Nikula
@ 2016-02-18 16:20 ` Jani Nikula
2016-02-18 16:20 ` [maintainer-tools PATCH 8/8] completion: complete aliases like the actual command Jani Nikula
2016-02-19 14:31 ` [maintainer-tools PATCH 1/8] completion: require bash completion package and use it Jani Nikula
7 siblings, 0 replies; 9+ messages in thread
From: Jani Nikula @ 2016-02-18 16:20 UTC (permalink / raw)
To: intel-gfx; +Cc: jani.nikula
Autodiscover everything, including user's configured aliases.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
bash_completion | 16 +---------------
1 file changed, 1 insertion(+), 15 deletions(-)
diff --git a/bash_completion b/bash_completion
index f89764e3947d..4a9d981709a0 100644
--- a/bash_completion
+++ b/bash_completion
@@ -12,7 +12,6 @@ dim ()
_dim ()
{
local args arg cur prev words cword split
- local cmds
# require bash-completion with _init_completion
type -t _init_completion >/dev/null 2>&1 || return
@@ -30,20 +29,6 @@ _dim ()
local nightly_branches="$(dim list-branches)"
local upstream_branches="$(dim list-upstreams)"
- cmds="setup nightly-forget update-branches"
- cmds="$cmds rebuild-nightly cat-to-fixup"
- cmds="$cmds push-queued pq push-fixes pf push-next-fixes pnf push-branch"
- cmds="$cmds checkout co conq cof conf"
- cmds="$cmds apply-branch ab sob apply-queued aq apply-fixes af apply-next-fixes anf"
- cmds="$cmds magic-patch mp cd"
- cmds="$cmds magic-rebase-resolve mrr"
- cmds="$cmds apply-igt ai"
- cmds="$cmds apply-resolved ar tc fixes check-patch cp cherry-pick"
- cmds="$cmds pull-request pull-request-fixes pull-request-next pull-request-next-fixes"
- cmds="$cmds update-next"
- cmds="$cmds create-branch remove-branch create-workdir for-each-workdirs fw"
- cmds="$cmds tag-next checker"
-
if [ -z "${arg}" ]; then
# top level completion
case "${cur}" in
@@ -52,6 +37,7 @@ _dim ()
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
;;
*)
+ local cmds="$(dim list-commands) $(dim list-aliases | sed 's/\t.*//')"
COMPREPLY=( $(compgen -W "${cmds}" -- ${cur}) )
;;
esac
--
2.1.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [maintainer-tools PATCH 8/8] completion: complete aliases like the actual command
2016-02-18 16:20 [maintainer-tools PATCH 1/8] completion: require bash completion package and use it Jani Nikula
` (5 preceding siblings ...)
2016-02-18 16:20 ` [maintainer-tools PATCH 7/8] completion: use the dim helpers to complete subcommands and aliases Jani Nikula
@ 2016-02-18 16:20 ` Jani Nikula
2016-02-19 14:31 ` [maintainer-tools PATCH 1/8] completion: require bash completion package and use it Jani Nikula
7 siblings, 0 replies; 9+ messages in thread
From: Jani Nikula @ 2016-02-18 16:20 UTC (permalink / raw)
To: intel-gfx; +Cc: jani.nikula
Map aliases to the actual commands. No need to know all the aliases.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
bash_completion | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/bash_completion b/bash_completion
index 4a9d981709a0..9f659b4ebcce 100644
--- a/bash_completion
+++ b/bash_completion
@@ -44,20 +44,26 @@ _dim ()
return 0
fi
+ # complete aliases like the actual command
+ local aliasref=$(dim list-aliases | sed -n "s/^${arg}\t\(.*\)/\1/p")
+ if [[ -n "$aliasref" ]]; then
+ arg="$aliasref"
+ fi
+
case "${arg}" in
push-branch)
COMPREPLY=( $( compgen -W "-f $nightly_branches" -- $cur ) )
;;
- push-queued|pq|push-fixes|pf|push-next-fixes|pnf)
+ push-queued|push-fixes|push-next-fixes)
COMPREPLY=( $( compgen -W "-f" -- $cur ) )
;;
- apply-branch|ab|sob)
+ apply-branch)
COMPREPLY=( $( compgen -W "-s $nightly_branches" -- $cur ) )
;;
- apply-queued|aq|apply-fixes|af|apply-next-fixes|anf)
+ apply-queued|apply-fixes|apply-next-fixes)
COMPREPLY=( $( compgen -W "-s" -- $cur ) )
;;
- magic-patch|mp)
+ magic-patch)
if [[ $args == 2 ]]; then
COMPREPLY=( $( compgen -o nospace -W "-a" -- $cur ) )
fi
@@ -65,7 +71,7 @@ _dim ()
tc|fixes)
# FIXME needs a git sha1
;;
- check-patch|cp)
+ checkpatch)
# FIXME needs a git sha1
;;
pull-request)
@@ -85,7 +91,7 @@ _dim ()
COMPREPLY=( $( compgen -o nospace -W "drm- topic/" -- $cur ) )
fi
;;
- checkout|co)
+ checkout)
if [[ $args == 2 ]]; then
COMPREPLY=( $( compgen -W "$nightly_branches" -- $cur ) )
fi
--
2.1.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [maintainer-tools PATCH 1/8] completion: require bash completion package and use it
2016-02-18 16:20 [maintainer-tools PATCH 1/8] completion: require bash completion package and use it Jani Nikula
` (6 preceding siblings ...)
2016-02-18 16:20 ` [maintainer-tools PATCH 8/8] completion: complete aliases like the actual command Jani Nikula
@ 2016-02-19 14:31 ` Jani Nikula
7 siblings, 0 replies; 9+ messages in thread
From: Jani Nikula @ 2016-02-19 14:31 UTC (permalink / raw)
To: intel-gfx
On Thu, 18 Feb 2016, Jani Nikula <jani.nikula@intel.com> wrote:
> The bash completion package makes life a whole lot easier than using the
> builtin bash completion features. It's quite likely anyone using
> completion in bash already has it installed.
I boldly went ahead and pushed the lot. Please scream if
https://xkcd.com/1172/.
BR,
Jani.
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
> bash_completion | 62 ++++++++++++++++++++++++++++++++-------------------------
> 1 file changed, 35 insertions(+), 27 deletions(-)
>
> diff --git a/bash_completion b/bash_completion
> index e44e5fc844b4..6a3a88cc80f8 100644
> --- a/bash_completion
> +++ b/bash_completion
> @@ -11,7 +11,21 @@ dim ()
>
> _dim ()
> {
> - local cur cmds opts i
> + local args arg cur prev words cword split
> + local cmds
> +
> + # require bash-completion with _init_completion
> + type -t _init_completion >/dev/null 2>&1 || return
> +
> + _init_completion || return
> +
> + COMPREPLY=()
> +
> + # arg = subcommand
> + _get_first_arg
> +
> + # args = number of arguments
> + _count_args
>
> if [ -f ~/linux/drm-intel-rerere/nightly.conf ] ; then
> local nightly_branches=`(source ~/linux/drm-intel-rerere/nightly.conf ; echo $nightly_branches) | \
> @@ -35,27 +49,21 @@ _dim ()
> cmds="$cmds create-branch remove-branch create-workdir for-each-workdirs fw"
> cmds="$cmds tag-next checker"
>
> - opts="-d -f -i"
> -
> - i=1
> -
> - COMPREPLY=() # Array variable storing the possible completions.
> - cur=${COMP_WORDS[COMP_CWORD]}
> -
> - for comp in "${COMP_WORDS[@]}" ; do
> - for opt in $opts ; do
> - if [[ $opt = $comp ]] ; then
> - i=$((i+1))
> - fi
> - done
> - done
> -
> - if [[ $COMP_CWORD == "$i" ]] ; then
> - COMPREPLY=( $( compgen -W "$cmds $opts" -- $cur ) )
> + if [ -z "${arg}" ]; then
> + # top level completion
> + case "${cur}" in
> + -*)
> + local opts="-d -f -i"
> + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
> + ;;
> + *)
> + COMPREPLY=( $(compgen -W "${cmds}" -- ${cur}) )
> + ;;
> + esac
> return 0
> fi
>
> - case "${COMP_WORDS[i]}" in
> + case "${arg}" in
> push-branch)
> COMPREPLY=( $( compgen -W "-f $nightly_branches" -- $cur ) )
> ;;
> @@ -69,7 +77,7 @@ _dim ()
> COMPREPLY=( $( compgen -W "-s" -- $cur ) )
> ;;
> magic-patch|mp)
> - if [[ $COMP_CWORD == "$((i+1))" ]] ; then
> + if [[ $args == 2 ]]; then
> COMPREPLY=( $( compgen -o nospace -W "-a" -- $cur ) )
> fi
> ;;
> @@ -80,34 +88,34 @@ _dim ()
> # FIXME needs a git sha1
> ;;
> pull-request)
> - if [[ $COMP_CWORD == "$((i+1))" ]] ; then
> + if [[ $args == 2 ]]; then
> COMPREPLY=( $( compgen -W "$nightly_branches" -- $cur ) )
> - elif [[ $COMP_CWORD == "$((i+2))" ]] ; then
> + elif [[ $args == 3 ]]; then
> COMPREPLY=( $( compgen -W "$upstream_branches" -- $cur ) )
> fi
> ;;
> pull-request-next|pull-request-fixes|pull-request-next-fixes)
> - if [[ $COMP_CWORD == "$((i+1))" ]] ; then
> + if [[ $args == 2 ]]; then
> COMPREPLY=( $( compgen -W "$upstream_branches" -- $cur ) )
> fi
> ;;
> create-branch)
> - if [[ $COMP_CWORD == "$((i+1))" ]] ; then
> + if [[ $args == 2 ]]; then
> COMPREPLY=( $( compgen -o nospace -W "drm- topic/" -- $cur ) )
> fi
> ;;
> checkout|co)
> - if [[ $COMP_CWORD == "$((i+1))" ]] ; then
> + if [[ $args == 2 ]]; then
> COMPREPLY=( $( compgen -W "$nightly_branches" -- $cur ) )
> fi
> ;;
> remove-branch)
> - if [[ $COMP_CWORD == "$((i+1))" ]] ; then
> + if [[ $args == 2 ]]; then
> COMPREPLY=( $( compgen -W "$nightly_branches" -- $cur ) )
> fi
> ;;
> create-workdir)
> - if [[ $COMP_CWORD == "$((i+1))" ]] ; then
> + if [[ $args == 2 ]]; then
> COMPREPLY=( $( compgen -W "$nightly_branches all" -- $cur ) )
> fi
> ;;
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2016-02-19 14:31 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-18 16:20 [maintainer-tools PATCH 1/8] completion: require bash completion package and use it Jani Nikula
2016-02-18 16:20 ` [maintainer-tools PATCH 2/8] dim: add list-branches subcommand to list nightly branches Jani Nikula
2016-02-18 16:20 ` [maintainer-tools PATCH 3/8] dim: add list-upstreams subcommand to list upstream branches Jani Nikula
2016-02-18 16:20 ` [maintainer-tools PATCH 4/8] completion: use the dim helpers to complete nightly and " Jani Nikula
2016-02-18 16:20 ` [maintainer-tools PATCH 5/8] dim: add list-commands subcommand to list all subcommands Jani Nikula
2016-02-18 16:20 ` [maintainer-tools PATCH 6/8] dim: rename alias subcommand to list-aliases Jani Nikula
2016-02-18 16:20 ` [maintainer-tools PATCH 7/8] completion: use the dim helpers to complete subcommands and aliases Jani Nikula
2016-02-18 16:20 ` [maintainer-tools PATCH 8/8] completion: complete aliases like the actual command Jani Nikula
2016-02-19 14:31 ` [maintainer-tools PATCH 1/8] completion: require bash completion package and use it Jani Nikula
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).