packaging: Add contrib installation
[platform/upstream/git.git] / generate-cmdlist.sh
index fa1e547..9dbbb08 100755 (executable)
@@ -6,11 +6,11 @@ die () {
 }
 
 command_list () {
-       grep -v '^#' "$1"
+       eval "grep -ve '^#' $exclude_programs" <"$1"
 }
 
 get_categories () {
-       tr ' ' '\n'|
+       tr ' ' '\012'|
        grep -v '^$' |
        sort |
        uniq
@@ -76,22 +76,13 @@ print_command_list () {
        echo "};"
 }
 
-print_config_list () {
-       cat <<EOF
-static const char *config_name_list[] = {
-EOF
-       grep -h '^[a-zA-Z].*\..*::$' Documentation/*config.txt |
-       sed '/deprecated/d; s/::$//; s/,  */\n/g' |
-       sort |
-       while read line
-       do
-               echo "  \"$line\","
-       done
-       cat <<EOF
-       NULL,
-};
-EOF
-}
+exclude_programs=
+while test "--exclude-program" = "$1"
+do
+       shift
+       exclude_programs="$exclude_programs -e \"^$1 \""
+       shift
+done
 
 echo "/* Automatically generated by generate-cmdlist.sh */
 struct cmdname_help {
@@ -105,5 +96,3 @@ echo
 define_category_names "$1"
 echo
 print_command_list "$1"
-echo
-print_config_list