forked from mquinson/po4a
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes: mquinson#417 Signed-off-by: Alexander Golubev <[email protected]>
- Loading branch information
Showing
8 changed files
with
87 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# bash completion for po4a(7) utilities. -*- shell-script -*- | ||
# this file provides completion for msguntypot | ||
|
||
_comp_cmd_po4a_msguntypot() { | ||
local cur prev words cword comp_args | ||
_comp_initialize -- "$@" || return | ||
|
||
if [[ $cur == -* ]]; then | ||
COMPREPLY=( $( compgen -W '-o -n' -- "$cur" ) ) | ||
return | ||
fi | ||
|
||
_filedir | ||
} && complete -F _comp_cmd_po4a_msguntypot msguntypot | ||
|
||
# ex: filetype=sh |
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,50 @@ | ||
# bash completion for po4a(7) utilities. -*- shell-script -*- | ||
# this file provides completions for po4a itself and old-style scripts: | ||
# po4a-updatepo po4a-normalize po4a-gettextize po4a-translate | ||
|
||
_comp_cmd_po4a_utils() { | ||
local cur prev words cword comp_args | ||
_comp_initialize -- "$@" || return | ||
|
||
local cmd="$(basename "${comp_args[0]}")" | ||
|
||
case $prev in | ||
-h | --help | -V | --version) return ;; | ||
--help-format) [[ "$cmd" != "po4a" ]] && return ;; | ||
--porefs) | ||
if [[ "$cmd" != "po4a-translate" ]]; then | ||
COMPREPLY=( $( compgen -W 'never file counter full' -- "$cur" ) ) | ||
return | ||
fi | ||
;; | ||
-f | --format) | ||
if [[ "$cmd" != "po4a" ]]; then | ||
local formats=" | ||
$(command "${cmd}" --help-format 2>&1 | { | ||
local rx='^ - ([a-z]+):'; | ||
while IFS= read line; do | ||
[[ $line =~ $rx ]] && echo "${BASH_REMATCH[1]}" | ||
done | ||
})" | ||
|
||
COMPREPLY=( $( compgen -W "${formats}" -- "$cur" ) ) | ||
return | ||
fi | ||
;; | ||
esac | ||
|
||
if [[ $cur == -* ]]; then | ||
# po4a lists some arguments of other commands in its help message and | ||
# they can end up first on the line e.g. msgmerge's "-U", so we should | ||
# avoid leeking them to complitiones | ||
_comp_compgen_help - < <( | ||
command "${comp_args[0]}" --help 2>/dev/null | | ||
command grep '^ -' 2>/dev/null | ||
) | ||
return | ||
fi | ||
|
||
_filedir | ||
} && complete -F _comp_cmd_po4a_utils po4a po4a-updatepo po4a-normalize po4a-gettextize po4a-translate | ||
|
||
# ex: filetype=sh |
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 @@ | ||
po4a-display-pod |
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,16 @@ | ||
# bash completion for po4a(7) utilities. -*- shell-script -*- | ||
# this file provides completion for po4a-display-pod and po4a-display-man | ||
|
||
_comp_cmd_po4a_scripts() { | ||
local cur prev words cword comp_args | ||
_comp_initialize -- "$@" || return | ||
|
||
if [[ $cur == -* ]]; then | ||
COMPREPLY=( $( compgen -W '-m -o -p' -- "$cur" ) ) | ||
return | ||
fi | ||
|
||
_filedir | ||
} && complete -F _comp_cmd_po4a_scripts po4a-display-pod po4a-display-man | ||
|
||
# ex: filetype=sh |
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 @@ | ||
po4a |
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 @@ | ||
po4a |
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 @@ | ||
po4a |
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 @@ | ||
po4a |