All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masatake YAMATO <yamato@redhat.com>
To: util-linux@vger.kernel.org
Cc: yamato@redhat.com
Subject: [PATCH 4/4] bash-completion: add a function for fincore command
Date: Tue,  7 Mar 2017 11:33:52 +0900	[thread overview]
Message-ID: <20170307023352.7340-5-yamato@redhat.com> (raw)
In-Reply-To: <20170307023352.7340-1-yamato@redhat.com>

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
---
 bash-completion/Makemodule.am |  3 +++
 bash-completion/fincore       | 25 +++++++++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 bash-completion/fincore

diff --git a/bash-completion/Makemodule.am b/bash-completion/Makemodule.am
index 3ffd124..ff7b052 100644
--- a/bash-completion/Makemodule.am
+++ b/bash-completion/Makemodule.am
@@ -18,6 +18,9 @@ endif
 if BUILD_COLUMN
 dist_bashcompletion_DATA += bash-completion/column
 endif
+if BUILD_FINCORE
+dist_bashcompletion_DATA += bash-completion/fincore
+endif
 if BUILD_FINDMNT
 dist_bashcompletion_DATA += bash-completion/findmnt
 endif
diff --git a/bash-completion/fincore b/bash-completion/fincore
new file mode 100644
index 0000000..d213586
--- /dev/null
+++ b/bash-completion/fincore
@@ -0,0 +1,25 @@
+_fincore_module()
+{
+	local cur prev OPTS
+	COMPREPLY=()
+	cur="${COMP_WORDS[COMP_CWORD]}"
+	prev="${COMP_WORDS[COMP_CWORD-1]}"
+	case $prev in
+		'-h'|'--help'|'-V'|'--version')
+			return 0
+			;;
+	esac
+	case $cur in
+	    -*)
+			OPTS="--help
+				--version"
+			COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
+			return 0
+			;;
+	esac
+	local IFS=$'\n'
+	compopt -o filenames
+	COMPREPLY=( $(compgen -f -- ${cur:-"/"}) )
+	return 0
+}
+complete -F _fincore_module fincore
-- 
2.9.3


  parent reply	other threads:[~2017-03-07  2:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-07  2:33 [PATCH 0/4] fincore command Masatake YAMATO
2017-03-07  2:33 ` [PATCH 1/4] fincore: new command for counting pages of file contents in core Masatake YAMATO
2017-03-07  2:33 ` [PATCH 2/4] man: add a page for fincore command Masatake YAMATO
2017-03-07  2:33 ` [PATCH 3/4] tests: add cases for testing " Masatake YAMATO
2017-03-07  2:33 ` Masatake YAMATO [this message]
2017-03-13 14:50 ` [PATCH 0/4] " Karel Zak
2017-03-14 17:52   ` Masatake YAMATO
2017-03-23 11:33     ` Karel Zak
2017-03-23 11:58 ` Karel Zak
2017-03-23 14:45   ` Karel Zak
2017-03-27  0:41     ` Masatake YAMATO
2017-03-27 11:09       ` Karel Zak

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=20170307023352.7340-5-yamato@redhat.com \
    --to=yamato@redhat.com \
    --cc=util-linux@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.