diff --git a/Makefile.am b/Makefile.am index a6221e91..5b52d1a3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -96,6 +96,15 @@ check-local: configure-documentation configure-documentation: $(AM_V_CHKOPTS)$(top_srcdir)/script/check-cmdline-options-doc.sh \ - --program "$(top_srcdir)/configure" --text-doc "$(top_srcdir)/INSTALL-WMAKER" + --program "$(top_srcdir)/configure" --text-doc "$(top_srcdir)/INSTALL-WMAKER" \ + --ignore-prg 'with-PACKAGE,without-PACKAGE # only template names from Autoconf' \ + --ignore-prg 'program-prefix,program-suffix,program-transform-name # in INSTALL' \ + --ignore-prg 'version,quiet,srcdir,build,host,cache-file,no-create # in INSTALL' \ + --ignore-prg 'enable-silent-rules,disable-silent-rules # should be in INSTALL' \ + --ignore-prg 'enable-dependency-tracking,disable-dependency-tracking # in INSTALL' \ + --ignore-prg 'enable-shared,enable-static # should be in INSTALL' \ + --ignore-prg 'disable-option-checking,enable-fast-install # should be in INSTALL' \ + --ignore-prg 'disable-libtool-lock,with-pic,with-gnu-ld,with-sysroot # for libtool' \ + --ignore-prg 'with-x # no use, it would not work without X' .PHONY: configure-documentation diff --git a/script/check-cmdline-options-doc.sh b/script/check-cmdline-options-doc.sh index 76ad9f79..ff4a4be9 100755 --- a/script/check-cmdline-options-doc.sh +++ b/script/check-cmdline-options-doc.sh @@ -51,6 +51,8 @@ print_help() { echo "$0: check program's list of options against its documentation" echo "Usage: $0 options..." echo "valid options are:" + echo " --ignore-prg arg : ignore option '--arg' from program's output" + echo " (syntax: 'arg1,arg2,... # reason', args without leading '--')" echo " --man-page file : program's documentation file, in man format" echo " --program name : name of the program to run with '--help'" echo " --text-doc file : program's documentation file, in plain text format" @@ -60,6 +62,16 @@ print_help() { # Extract command line arguments while [ $# -gt 0 ]; do case $1 in + --ignore-prg) + shift + echo "$1" | grep '#' > /dev/null || echo "Warning: no reason provided for --ignore-prg on \"$1\"" >&2 + for arg in `echo "$1" | sed -e 's/#.*$// ; s/,/ /g' ` + do + ignore_arg_program="$ignore_arg_program +--$arg" + done + ;; + --man-page) shift [ -z "$man_page$text_doc" ] || arg_error "only 1 documentation file can be used (option: --man-page)" @@ -112,6 +124,17 @@ prog_options=`$prog_name --help | sed -n '/^[ \t]*-/ { s/^[ \t]*// ; s/^-[^-],[ [ "x$prog_options" = "x" ] && arg_error "program '$prog_name --help' did not return any option" +# We filter options that user wants us to, but we warn if the user asked to filter an option that is +# not actually present, to make sure his command line invocation stays up to date +for filter in $ignore_arg_program +do + if echo "$prog_options" | grep "^$filter\$" > /dev/null ; then + prog_options=`echo "$prog_options" | grep -v "^$filter\$" ` + else + echo "Warning: program's option does not contain \"$filter\", specified in \"--ignore-prg\"" + fi +done + if [ -n "$man_page" ]; then # In the man page format, the options must be grouped in the section "OPTIONS"