From cde7e6ccc4945b91650448e37bf68dfdaddf5460 Mon Sep 17 00:00:00 2001 From: Masataro Asai Date: Sat, 9 Jan 2016 23:33:57 +0900 Subject: [PATCH] bash completion --- etc/bash-completion.d/ros | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 etc/bash-completion.d/ros diff --git a/etc/bash-completion.d/ros b/etc/bash-completion.d/ros new file mode 100755 index 0000000..5ba0041 --- /dev/null +++ b/etc/bash-completion.d/ros @@ -0,0 +1,21 @@ +#!/bin/bash + +# currently just a stub. +# would it be possible to generate the completion from the roswell scripts by themselves? + +# https://www.debian-administration.org/article/317/An_introduction_to_bash_completion_part_2 + +_ros() +{ + local cur prev opts + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + opts="--help --verbose --version" + + if [[ ${cur} == -* ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + return 0 + fi +} +complete -F _ros ros