Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'generate-cmdlist.sh')
-rwxr-xr-xgenerate-cmdlist.sh23
1 files changed, 12 insertions, 11 deletions
diff --git a/generate-cmdlist.sh b/generate-cmdlist.sh
index f50112c50f..9b7d6aea62 100755
--- a/generate-cmdlist.sh
+++ b/generate-cmdlist.sh
@@ -17,16 +17,6 @@ category_list () {
LC_ALL=C sort -u
}
-get_synopsis () {
- sed -n '
- /^NAME/,/'"$1"'/H
- ${
- x
- s/.*'"$1"' - \(.*\)/N_("\1")/
- p
- }' "Documentation/$1.txt"
-}
-
define_categories () {
echo
echo "/* Command categories */"
@@ -61,7 +51,18 @@ print_command_list () {
command_list "$1" |
while read cmd rest
do
- printf " { \"$cmd\", $(get_synopsis $cmd), 0"
+ synopsis=
+ while read line
+ do
+ case "$line" in
+ "$cmd - "*)
+ synopsis=${line#$cmd - }
+ break
+ ;;
+ esac
+ done <"Documentation/$cmd.txt"
+
+ printf '\t{ "%s", N_("%s"), 0' "$cmd" "$synopsis"
printf " | CAT_%s" $rest
echo " },"
done