]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
bash-completion: text-utils
authorSami Kerola <kerolasa@iki.fi>
Tue, 26 Mar 2013 19:40:20 +0000 (19:40 +0000)
committerSami Kerola <kerolasa@iki.fi>
Mon, 1 Apr 2013 16:41:55 +0000 (17:41 +0100)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
shell-completion/col [new file with mode: 0644]
shell-completion/colcrt [new file with mode: 0644]
shell-completion/colrm [new file with mode: 0644]
shell-completion/column [new file with mode: 0644]
shell-completion/hexdump [new file with mode: 0644]
shell-completion/more [new file with mode: 0644]
shell-completion/pg [new file with mode: 0644]
shell-completion/rev [new file with mode: 0644]
shell-completion/tailf [new file with mode: 0644]
shell-completion/ul [new file with mode: 0644]

diff --git a/shell-completion/col b/shell-completion/col
new file mode 100644 (file)
index 0000000..9ad3a67
--- /dev/null
@@ -0,0 +1,24 @@
+_col_module()
+{
+       local cur prev OPTS
+       COMPREPLY=()
+       cur="${COMP_WORDS[COMP_CWORD]}"
+       prev="${COMP_WORDS[COMP_CWORD-1]}"
+       case $prev in
+               '-l'|'--lines')
+                       COMPREPLY=( $(compgen -W "number" -- $cur) )
+                       return 0
+                       ;;
+       esac
+       OPTS="-b --no-backspaces
+               -f --fine
+               -p --pass
+               -h --tabs
+               -x --spaces
+               -l --lines
+               -V --version
+               -H --help"
+       COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
+       return 0
+}
+complete -F _col_module col
diff --git a/shell-completion/colcrt b/shell-completion/colcrt
new file mode 100644 (file)
index 0000000..628416e
--- /dev/null
@@ -0,0 +1,20 @@
+_colcrt_module()
+{
+       local cur OPTS
+       COMPREPLY=()
+       cur="${COMP_WORDS[COMP_CWORD]}"
+       case $cur in
+               -*)
+                       OPTS="  -  --no-underlining
+                               -2 --half-lines
+                               -V --version
+                               -h --help"
+                       COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
+                       return 0
+                       ;;
+       esac
+       compopt -o filenames
+       COMPREPLY=( $(compgen -f -- $cur) )
+       return 0
+}
+complete -F _colcrt_module colcrt
diff --git a/shell-completion/colrm b/shell-completion/colrm
new file mode 100644 (file)
index 0000000..aa57c02
--- /dev/null
@@ -0,0 +1,23 @@
+_colrm_module()
+{
+       local cur OPTS
+       COMPREPLY=()
+       cur="${COMP_WORDS[COMP_CWORD]}"
+       case $cur in
+               -*)
+                       OPTS="-V --version -h --help"
+                       COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
+                       return 0
+                       ;;
+       esac
+       case $COMP_CWORD in
+               1)
+                       COMPREPLY=( $(compgen -W "startcol" -- $cur) )
+                       ;;
+               2)
+                       COMPREPLY=( $(compgen -W "endcol" -- $cur) )
+                       ;;
+       esac
+       return 0
+}
+complete -F _colrm_module colrm
diff --git a/shell-completion/column b/shell-completion/column
new file mode 100644 (file)
index 0000000..94e1a51
--- /dev/null
@@ -0,0 +1,34 @@
+_column_module()
+{
+       local cur prev OPTS
+       COMPREPLY=()
+       cur="${COMP_WORDS[COMP_CWORD]}"
+       prev="${COMP_WORDS[COMP_CWORD-1]}"
+       case $prev in
+               '-c'|'--columns')
+                       COMPREPLY=( $(compgen -W "number" -- $cur) )
+                       return 0
+                       ;;
+               '-s'|'--separator'|'-o'|'--output-separator')
+                       COMPREPLY=( $(compgen -W "string" -- $cur) )
+                       return 0
+                       ;;
+       esac
+       case $cur in
+               -*)
+                       OPTS="-c --columns
+                               -t --table
+                               -s --separator
+                               -o --output-separator
+                               -x --fillrows
+                               -h --help
+                               -V --version"
+                       COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
+                       return 0
+                       ;;
+       esac
+       compopt -o filenames
+       COMPREPLY=( $(compgen -f -- $cur) )
+       return 0
+}
+complete -F _column_module column
diff --git a/shell-completion/hexdump b/shell-completion/hexdump
new file mode 100644 (file)
index 0000000..1a6786b
--- /dev/null
@@ -0,0 +1,32 @@
+_hexdump_module()
+{
+       local cur prev OPTS
+       COMPREPLY=()
+       cur="${COMP_WORDS[COMP_CWORD]}"
+       prev="${COMP_WORDS[COMP_CWORD-1]}"
+       case $prev in
+               '-e')
+                       COMPREPLY=( $(compgen -W "format" -- $cur) )
+                       return 0
+                       ;;
+               '-n')
+                       COMPREPLY=( $(compgen -W "length" -- $cur) )
+                       return 0
+                       ;;
+               '-s')
+                       COMPREPLY=( $(compgen -W "offset" -- $cur) )
+                       return 0
+                       ;;
+       esac
+       case $cur in
+               -*)
+                       OPTS="-b -c -C -d -o -x -e -f -n -s -v -V"
+                       COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
+                       return 0
+                       ;;
+       esac
+       compopt -o filenames
+       COMPREPLY=( $(compgen -f -- $cur) )
+       return 0
+}
+complete -F _hexdump_module hexdump
diff --git a/shell-completion/more b/shell-completion/more
new file mode 100644 (file)
index 0000000..f32770d
--- /dev/null
@@ -0,0 +1,22 @@
+_more_module()
+{
+       local cur OPTS
+       COMPREPLY=()
+       cur="${COMP_WORDS[COMP_CWORD]}"
+       case $cur in
+               -*)
+                       OPTS="-d -f -l -p -c -u -s -number -V"
+                       COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
+                       return 0
+                       ;;
+               +*)
+                       OPTS="+number +/string"
+                       COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
+                       return 0
+                       ;;
+       esac
+       compopt -o filenames
+       COMPREPLY=( $(compgen -f -- $cur) )
+       return 0
+}
+complete -F _more_module more
diff --git a/shell-completion/pg b/shell-completion/pg
new file mode 100644 (file)
index 0000000..4ae8887
--- /dev/null
@@ -0,0 +1,29 @@
+_pg_module()
+{
+       local cur prev OPTS
+       COMPREPLY=()
+       cur="${COMP_WORDS[COMP_CWORD]}"
+       prev="${COMP_WORDS[COMP_CWORD-1]}"
+       case $prev in
+               '-p')
+                       COMPREPLY=( $(compgen -W "prompt" -- $cur) )
+                       return 0
+                       ;;
+       esac
+       case $cur in
+               -*)
+                       OPTS="-number -c -e -f -n -p -r -s -h -V"
+                       COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
+                       return 0
+                       ;;
+               +*)
+                       OPTS="+number +/pattern/"
+                       COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
+                       return 0
+                       ;;
+       esac
+       compopt -o filenames
+       COMPREPLY=( $(compgen -f -- $cur) )
+       return 0
+}
+complete -F _pg_module pg
diff --git a/shell-completion/rev b/shell-completion/rev
new file mode 100644 (file)
index 0000000..f891f19
--- /dev/null
@@ -0,0 +1,17 @@
+_rev_module()
+{
+       local cur OPTS
+       COMPREPLY=()
+       cur="${COMP_WORDS[COMP_CWORD]}"
+       case $cur in
+               -*)
+                       OPTS="-V --version -h --help"
+                       COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
+                       return 0
+                       ;;
+       esac
+       compopt -o filenames
+       COMPREPLY=( $(compgen -f -- $cur) )
+       return 0
+}
+complete -F _rev_module rev
diff --git a/shell-completion/tailf b/shell-completion/tailf
new file mode 100644 (file)
index 0000000..29c5bed
--- /dev/null
@@ -0,0 +1,24 @@
+_tailf_module()
+{
+       local cur prev OPTS
+       COMPREPLY=()
+       cur="${COMP_WORDS[COMP_CWORD]}"
+       prev="${COMP_WORDS[COMP_CWORD-1]}"
+       case $prev in
+               '-n'|'--lines')
+                       COMPREPLY=( $(compgen -W "number" -- $cur) )
+                       return 0
+                       ;;
+       esac
+       case $cur in
+               -*)
+                       OPTS="-n --lines -number -V --version -h --help"
+                       COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
+                       return 0
+                       ;;
+       esac
+       compopt -o filenames
+       COMPREPLY=( $(compgen -f -- $cur) )
+       return 0
+}
+complete -F _tailf_module tailf
diff --git a/shell-completion/ul b/shell-completion/ul
new file mode 100644 (file)
index 0000000..07d0731
--- /dev/null
@@ -0,0 +1,29 @@
+_ul_module()
+{
+       local cur prev OPTS
+       COMPREPLY=()
+       cur="${COMP_WORDS[COMP_CWORD]}"
+       prev="${COMP_WORDS[COMP_CWORD-1]}"
+       case $prev in
+               '-t'|'--terminal')
+                       local TERM_LIST I
+                       TERM_LIST=''
+                       for I in /usr/share/terminfo/?/*; do
+                               TERM_LIST+="${I##*/} "
+                       done
+                       COMPREPLY=( $(compgen -W "$TERM_LIST" -- $cur) )
+                       return 0
+                       ;;
+       esac
+       case $cur in
+               -*)
+                       OPTS="-t --terminal -i --indicated -V --version -h --help"
+                       COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
+                       return 0
+                       ;;
+       esac
+       compopt -o filenames
+       COMPREPLY=( $(compgen -f -- $cur) )
+       return 0
+}
+complete -F _ul_module ul