From 9bc4abb0a7f8760a757181adfa87dd021a305662 Mon Sep 17 00:00:00 2001 From: Marcus Whybrow Date: Thu, 31 May 2012 08:40:16 +0100 Subject: [PATCH] Added bash completion for the server "jar" command. --- bash_completion/msm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bash_completion/msm b/bash_completion/msm index 1a69483..d73c6fe 100644 --- a/bash_completion/msm +++ b/bash_completion/msm @@ -80,6 +80,16 @@ _msm() { ;; esac fi + ;; + jar) + if [[ $COMP_CWORD == 3 && -d "$JAR_STORAGE_PATH" ]]; then + options="$(ls -1 "$JAR_STORAGE_PATH")" + fi + + if [[ $COMP_CWORD == 4 && -d "$JAR_STORAGE_PATH/${COMP_WORDS[3]}" ]]; then + options="$(find "$JAR_STORAGE_PATH/${COMP_WORDS[3]}" -type f -name "*.jar" -exec basename {} \;)" + fi + ;; esac fi