Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split bash-completion snippet in small ones
/usr/share/bash-completion/completions/ now uses dynamic loading based on file name.
- Loading branch information
Nirgal Vourgère
committed
May 30, 2015
1 parent
428834b
commit 584119e
Showing
13 changed files
with
219 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
EXTRA_DIST = mdb-export mdb-hexdump mdb-import mdb-parsecsv mdb-prop mdb-schema mdb-sql mdb-tables mdb-ver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#-*- mode: shell-script;-*- | ||
have mdb-export && | ||
_mdb_export() | ||
{ | ||
local cur prev | ||
COMPREPLY=() | ||
cur=${COMP_WORDS[COMP_CWORD]} | ||
prev=${COMP_WORDS[COMP_CWORD-1]} | ||
|
||
if [[ "$prev" == -@(d|-delimiter|R|-row-delimiter|q|-quote|X|-escape|D|-date-format|N|-namespace|h|-help) ]] ; then | ||
return 0 | ||
elif [[ "$prev" == -I ]] ; then | ||
COMPREPLY=( $( compgen -W 'access sybase oracle postgres mysql' -- $cur ) ) | ||
elif [[ "$prev" == -@(b|-bin) ]] ; then | ||
COMPREPLY=( $( compgen -W 'strip raw octal' -- $cur ) ) | ||
elif [[ "$cur" == -* ]]; then | ||
COMPREPLY=( $( compgen -W '-H -d -R -Q -q -X -I -D -N -b -h \ | ||
--no-header --no-quote --delimiter --row-delimiter --insert \ | ||
--date-format --quote --escape --namespace --bin --help' -- $cur ) ) | ||
elif [[ "$prev" == *@(mdb|mdw|accdb) ]] ; then | ||
local dbname | ||
local tablenames | ||
dbname=$prev | ||
__expand_tilde_by_ref dbname | ||
tablenames=$(eval mdb-tables -S -d / "${dbname}" 2>/dev/null) | ||
COMPREPLY=( $( IFS=/ compgen -W "${tablenames}" -- $cur ) ) | ||
else | ||
_filedir '@(mdb|mdw|accdb)' | ||
fi | ||
return 0 | ||
} && | ||
complete -F _mdb_export mdb-export |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#-*- mode: shell-script;-*- | ||
have mdb-hexdump && | ||
_mdb_hexdump() | ||
{ | ||
local cur | ||
COMPREPLY=() | ||
cur=${COMP_WORDS[COMP_CWORD]} | ||
|
||
if (( COMP_CWORD == 1 )); then | ||
_filedir '@(mdb|mdw|accdb)' | ||
fi | ||
return 0 | ||
} && | ||
complete -F _mdb_hexdump mdb-hexdump |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#-*- mode: shell-script;-*- | ||
have mdb-import && | ||
_mdb_import() | ||
{ | ||
local cur | ||
|
||
COMPREPLY=() | ||
cur=${COMP_WORDS[COMP_CWORD]} | ||
prev=${COMP_WORDS[COMP_CWORD-1]} | ||
|
||
if [[ "$prev" == -@(d|-delimiter) ]]; then | ||
return 0 | ||
elif [[ "$cur" == -* ]]; then | ||
COMPREPLY=( $( compgen -W '-H --header \ | ||
-d --delimiter \ | ||
-h --help' -- $cur ) ) | ||
elif [[ "$prev" == @(*mdb|*mdw|*accdb) ]]; then | ||
local dbname | ||
local tablenames | ||
dbname=$prev | ||
__expand_tilde_by_ref dbname | ||
tablenames=$(eval mdb-tables -S -d / "${dbname}" 2>/dev/null) | ||
COMPREPLY=( $( IFS=/ compgen -W "${tablenames}" -- $cur ) ) | ||
else | ||
_filedir '@(mdb|mdw|accdb|txt|csv)' | ||
fi | ||
return 0 | ||
} && | ||
complete -F _mdb_import mdb-import |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#-*- mode: shell-script;-*- | ||
have mdb-parsecsv && | ||
_mdb_parsecsv() | ||
{ | ||
local cur | ||
COMPREPLY=() | ||
cur=${COMP_WORDS[COMP_CWORD]} | ||
|
||
if (( COMP_CWORD == 1 )); then | ||
_filedir '@(txt|csv)' | ||
fi | ||
return 0 | ||
} && | ||
complete -F _mdb_parsecsv mdb-parsecsv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#-*- mode: shell-script;-*- | ||
have mdb-prop && | ||
_mdb_prop() | ||
{ | ||
local cur | ||
|
||
COMPREPLY=() | ||
cur=${COMP_WORDS[COMP_CWORD]} | ||
|
||
if (( COMP_CWORD == 1 )); then | ||
_filedir '@(mdb|mdw|accdb)' | ||
elif (( COMP_CWORD == 2 )); then | ||
local dbname | ||
local tablenames | ||
dbname=${COMP_WORDS[1]} | ||
__expand_tilde_by_ref dbname | ||
tablenames=$(eval mdb-tables -S -d / "${dbname}" 2>/dev/null) | ||
COMPREPLY=( $( IFS=/ compgen -W "${tablenames}" -- $cur ) ) | ||
elif (( COMP_CWORD == 3 )); then | ||
COMPREPLY=( $( compgen -W 'Lv LvProp LvModule LvExtra' -- $cur ) ) | ||
fi | ||
return 0 | ||
} && | ||
complete -F _mdb_prop mdb-prop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#-*- mode: shell-script;-*- | ||
have mdb-schema && | ||
_mdb_schema() | ||
{ | ||
local cur prev | ||
|
||
COMPREPLY=() | ||
cur=${COMP_WORDS[COMP_CWORD]} | ||
prev=${COMP_WORDS[COMP_CWORD-1]} | ||
|
||
if [[ "$prev" == -@(T|-table|N|-namespace) ]] ; then | ||
return 0 | ||
elif [[ "$cur" == -* ]]; then | ||
COMPREPLY=( $( compgen -W '-T --table \ | ||
-N --namespace \ | ||
--drop-table --no-drop-table \ | ||
--not-null --no-not-null \ | ||
--default-values --no-default-values \ | ||
--not-empty --no-not-empty \ | ||
--indexes --no-indexes \ | ||
--relations --no-relations | ||
-h --help' -- $cur ) ) | ||
elif [[ "$prev" == @(*mdb|*mdw|*accdb) ]]; then | ||
COMPREPLY=( $( compgen -W 'access sybase oracle postgres mysql' -- $cur ) ) | ||
else | ||
_filedir '@(mdb|mdw|accdb)' | ||
fi | ||
return 0 | ||
} && | ||
complete -F _mdb_schema mdb-schema |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#-*- mode: shell-script;-*- | ||
have mdb-sql && | ||
_mdb_sql() | ||
{ | ||
local cur prev | ||
|
||
COMPREPLY=() | ||
cur=${COMP_WORDS[COMP_CWORD]} | ||
prev=${COMP_WORDS[COMP_CWORD-1]} | ||
|
||
if [[ "$prev" == -d ]] ; then | ||
return 0 | ||
elif [[ "$prev" == -@(i|-input|o|-output) ]] ; then | ||
_filedir | ||
elif [[ "$cur" == -* ]]; then | ||
COMPREPLY=( $( compgen -W '-H --no-header \ | ||
-F --no-footer \ | ||
-p --no-pretty-print \ | ||
-d --delimiter \ | ||
-i --input \ | ||
-o --output \ | ||
-h --help' -- $cur ) ) | ||
else | ||
_filedir '@(mdb|mdw|accdb)' | ||
fi | ||
return 0 | ||
} && | ||
complete -F _mdb_sql mdb-sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#-*- mode: shell-script;-*- | ||
have mdb-tables && | ||
_mdb_tables() | ||
{ | ||
local cur prev | ||
|
||
COMPREPLY=() | ||
cur=${COMP_WORDS[COMP_CWORD]} | ||
prev=${COMP_WORDS[COMP_CWORD-1]} | ||
|
||
if [[ "$prev" == -@(d|-delimiter) ]]; then | ||
return 0 | ||
elif [[ "$prev" == -@(t|-type) ]]; then | ||
COMPREPLY=( $( compgen -W 'form table macro systable report query linkedtable module relationship dbprop any all' -- $cur ) ) | ||
return 0 | ||
elif [[ "$cur" == -* ]]; then | ||
COMPREPLY=( $( compgen -W '-S --system\ | ||
-1 --single-column \ | ||
-d --delimiter \ | ||
-t --type \ | ||
-T --showtype \ | ||
-h --help' -- $cur ) ) | ||
else | ||
_filedir '@(mdb|mdw|accdb)' | ||
fi | ||
return 0 | ||
} && | ||
complete -F _mdb_tables mdb-tables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#-*- mode: shell-script;-*- | ||
have mdb-ver && | ||
_mdb_ver() | ||
{ | ||
local cur | ||
|
||
COMPREPLY=() | ||
cur=${COMP_WORDS[COMP_CWORD]} | ||
|
||
if [[ "$cur" == -* ]]; then | ||
COMPREPLY=( $( compgen -W '-M -h --help' -- $cur ) ) | ||
else | ||
_filedir '@(mdb|mdw|accdb)' | ||
fi | ||
return 0 | ||
} && | ||
complete -F _mdb_ver mdb-ver |
Oops, something went wrong.