[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 0ed0de30473e1ed2bd047ca864b56d99b44fa8e1
Ville Skyttä
ville.skytta at iki.fi
Sun Sep 19 11:34:07 UTC 2010
The following commit has been merged in the master branch:
commit 0ed0de30473e1ed2bd047ca864b56d99b44fa8e1
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Sun Sep 19 14:33:09 2010 +0300
Add badblocks, dumpe2fs, e2freefrag, e2label, filefrag, and tune2fs completions.
diff --git a/CHANGES b/CHANGES
index 5418c02..f272503 100644
--- a/CHANGES
+++ b/CHANGES
@@ -8,8 +8,8 @@ bash-completion (2.x)
[ Ville Skyttä ]
* Activate hping2 completion also for hping and hping3.
- * Add compgen, crontab, iftop, lrzip, POSIX sh, xmodmap, and xrdb
- completions.
+ * Add badblocks, compgen, crontab, dumpe2fs, e2freefrag, e2label, filefrag,
+ iftop, lrzip, POSIX sh, tune2fs, xmodmap, and xrdb completions.
* Add *.gif (Alioth: #312512), *.3gpp, *.3gpp2, and *.awb to mplayer
filename completions.
* Add "short" tarball extensions to unxz, unlzma etc completions.
diff --git a/completions/Makefile.am b/completions/Makefile.am
index ffd3fde..f335b5d 100644
--- a/completions/Makefile.am
+++ b/completions/Makefile.am
@@ -35,6 +35,7 @@ bashcomp_DATA = abook \
dpkg \
dselect \
dsniff \
+ e2fsprogs \
findutils \
freeciv \
freerdp \
diff --git a/completions/e2fsprogs b/completions/e2fsprogs
new file mode 100644
index 0000000..1a240f1
--- /dev/null
+++ b/completions/e2fsprogs
@@ -0,0 +1,179 @@
+# bash completion for e2fsprogs
+
+have badblocks &&
+_badblocks()
+{
+ COMPREPLY=()
+ local cur prev
+ _get_comp_words_by_ref cur prev
+
+ case $prev in
+ -b|-c|-e|-d|-p|-t)
+ return 0
+ ;;
+ -i|-o)
+ _filedir
+ return 0
+ ;;
+ esac
+
+ if [[ "$cur" == -* ]]; then
+ # -w (dangerous) and -X (internal use) not here on purpose
+ COMPREPLY=( $( compgen -W '-b -c -e -d -f -i -n -o -p -s -t -v' \
+ -- "$cur" ) )
+ return 0
+ fi
+
+ cur=${cur:=/dev/}
+ _filedir
+} &&
+complete -F _badblocks -o filenames badblocks
+
+
+have dumpe2fs &&
+_dumpe2fs()
+{
+ COMPREPLY=()
+ local cur prev
+ _get_comp_words_by_ref cur prev
+
+ case $prev in
+ -o|-V)
+ return 0
+ ;;
+ -i)
+ _filedir
+ return 0
+ ;;
+ esac
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '-b -o -f -h -i -x -V' -- "$cur" ) )
+ return 0
+ fi
+
+ cur=${cur:=/dev/}
+ _filedir
+} &&
+complete -F _dumpe2fs -o filenames dumpe2fs
+
+
+have e2freefrag &&
+_e2freefrag()
+{
+ COMPREPLY=()
+ local cur prev
+ _get_comp_words_by_ref cur prev
+
+ case $prev in
+ -c|-h)
+ return 0
+ ;;
+ esac
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '-c -h' -- "$cur" ) )
+ return 0
+ fi
+
+ cur=${cur:=/dev/}
+ _filedir
+} &&
+complete -F _e2freefrag -o filenames e2freefrag
+
+
+have e2label &&
+_e2label()
+{
+ COMPREPLY=()
+ local cur cword
+ _get_comp_words_by_ref cur cword
+
+ if [ $cword -eq 1 ]; then
+ cur=${cur:=/dev/}
+ _filedir
+ fi
+} &&
+complete -F _e2label -o filenames e2label
+
+
+have filefrag &&
+_filefrag()
+{
+ COMPREPLY=()
+ local cur
+ _get_comp_words_by_ref cur
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '-B -b -s -v -x' -- "$cur" ) )
+ return 0
+ fi
+
+ _filedir
+} &&
+complete -F _filefrag -o filenames filefrag
+
+
+have tune2fs &&
+_tune2fs()
+{
+ COMPREPLY=()
+ local cur prev
+ _get_comp_words_by_ref cur prev
+
+ case $prev in
+ -c|-C|-E|-i|-J|-L|-m|-r|-T)
+ return 0
+ ;;
+ -e)
+ COMPREPLY=( $( compgen -W 'continue remount-ro panic' -- "$cur" ) )
+ return 0
+ ;;
+ -g)
+ _gids
+ COMPREPLY=( $( compgen -g -W '${COMPREPLY[@]}' -- "$cur" ) )
+ return 0
+ ;;
+ -M)
+ _filedir -d
+ ;;
+ -o)
+ local -a opts=(^debug ^bsdgroups ^user_xattr ^acl ^uid16
+ ^journal_data ^journal_data_ordered ^journal_data_writeback)
+ COMPREPLY=( $( compgen -W '${opts[@]} ${opts[@]#^}' -- "$cur" ) )
+ return 0
+ ;;
+ -O)
+ local -a opts=(^dir_index ^filetype ^flex_bg ^has_journal
+ ^large_file ^resize_inode ^sparse_super ^uninit_bg)
+ COMPREPLY=( $( compgen -W '${opts[@]} ${opts[@]#^}' -- "$cur" ) )
+ return 0
+ ;;
+ -u)
+ _uids
+ COMPREPLY=( $( compgen -u -W '${COMPREPLY[@]}' -- "$cur" ) )
+ return 0
+ ;;
+ -U)
+ COMPREPLY=( $( compgen -W 'clear random time' -- "$cur" ) )
+ return 0
+ ;;
+ esac
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '-c -C -e -E -f -g -i -j -J -l -L -m -M -o
+ -O -r -T -u -U' -- "$cur" ) )
+ fi
+
+ cur=${cur:=/dev/}
+ _filedir
+} &&
+complete -F _tune2fs -o filenames tune2fs
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/test/completion/badblocks.exp b/test/completion/badblocks.exp
new file mode 100644
index 0000000..74bfcd5
--- /dev/null
+++ b/test/completion/badblocks.exp
@@ -0,0 +1 @@
+assert_source_completions badblocks
diff --git a/test/completion/dumpe2fs.exp b/test/completion/dumpe2fs.exp
new file mode 100644
index 0000000..22d1523
--- /dev/null
+++ b/test/completion/dumpe2fs.exp
@@ -0,0 +1 @@
+assert_source_completions dumpe2fs
diff --git a/test/completion/e2freefrag.exp b/test/completion/e2freefrag.exp
new file mode 100644
index 0000000..713ee23
--- /dev/null
+++ b/test/completion/e2freefrag.exp
@@ -0,0 +1 @@
+assert_source_completions e2freefrag
diff --git a/test/completion/e2label.exp b/test/completion/e2label.exp
new file mode 100644
index 0000000..2383c98
--- /dev/null
+++ b/test/completion/e2label.exp
@@ -0,0 +1 @@
+assert_source_completions e2label
diff --git a/test/completion/filefrag.exp b/test/completion/filefrag.exp
new file mode 100644
index 0000000..eeb5f8c
--- /dev/null
+++ b/test/completion/filefrag.exp
@@ -0,0 +1 @@
+assert_source_completions filefrag
diff --git a/test/completion/tune2fs.exp b/test/completion/tune2fs.exp
new file mode 100644
index 0000000..db03496
--- /dev/null
+++ b/test/completion/tune2fs.exp
@@ -0,0 +1 @@
+assert_source_completions tune2fs
diff --git a/test/lib/completions/animate.exp b/test/lib/completions/badblocks.exp
similarity index 78%
copy from test/lib/completions/animate.exp
copy to test/lib/completions/badblocks.exp
index 12314d7..d453b5b 100644
--- a/test/lib/completions/animate.exp
+++ b/test/lib/completions/badblocks.exp
@@ -11,7 +11,7 @@ proc teardown {} {
setup
-assert_complete_any "animate "
+assert_complete_any "badblocks "
sync_after_int
diff --git a/test/lib/completions/animate.exp b/test/lib/completions/dumpe2fs.exp
similarity index 78%
copy from test/lib/completions/animate.exp
copy to test/lib/completions/dumpe2fs.exp
index 12314d7..e935c50 100644
--- a/test/lib/completions/animate.exp
+++ b/test/lib/completions/dumpe2fs.exp
@@ -11,7 +11,7 @@ proc teardown {} {
setup
-assert_complete_any "animate "
+assert_complete_any "dumpe2fs "
sync_after_int
diff --git a/test/lib/completions/abook.exp b/test/lib/completions/e2freefrag.exp
similarity index 77%
copy from test/lib/completions/abook.exp
copy to test/lib/completions/e2freefrag.exp
index 43f6272..1530c9c 100644
--- a/test/lib/completions/abook.exp
+++ b/test/lib/completions/e2freefrag.exp
@@ -11,7 +11,7 @@ proc teardown {} {
setup
-assert_complete_any "abook "
+assert_complete_any "e2freefrag "
sync_after_int
diff --git a/test/lib/completions/animate.exp b/test/lib/completions/e2label.exp
similarity index 79%
copy from test/lib/completions/animate.exp
copy to test/lib/completions/e2label.exp
index 12314d7..8ae7f44 100644
--- a/test/lib/completions/animate.exp
+++ b/test/lib/completions/e2label.exp
@@ -11,7 +11,7 @@ proc teardown {} {
setup
-assert_complete_any "animate "
+assert_complete_any "e2label "
sync_after_int
diff --git a/test/lib/completions/animate.exp b/test/lib/completions/filefrag.exp
similarity index 78%
copy from test/lib/completions/animate.exp
copy to test/lib/completions/filefrag.exp
index 12314d7..fa80cd0 100644
--- a/test/lib/completions/animate.exp
+++ b/test/lib/completions/filefrag.exp
@@ -11,7 +11,7 @@ proc teardown {} {
setup
-assert_complete_any "animate "
+assert_complete_any "filefrag "
sync_after_int
diff --git a/test/lib/completions/animate.exp b/test/lib/completions/tune2fs.exp
similarity index 79%
copy from test/lib/completions/animate.exp
copy to test/lib/completions/tune2fs.exp
index 12314d7..df70d90 100644
--- a/test/lib/completions/animate.exp
+++ b/test/lib/completions/tune2fs.exp
@@ -11,7 +11,7 @@ proc teardown {} {
setup
-assert_complete_any "animate "
+assert_complete_any "tune2fs "
sync_after_int
--
bash-completion
More information about the Bash-completion-commits
mailing list