qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 4/5] configure: Get help text from meson_options.txt


From: Eric Blake
Subject: Re: [PATCH v2 4/5] configure: Get help text from meson_options.txt
Date: Fri, 3 Sep 2021 12:20:06 -0500
User-agent: NeoMutt/20210205-739-420e15

On Fri, Sep 03, 2021 at 10:13:57AM +0200, Thomas Huth wrote:
> It's cumbersome to maintain the option help texts twice, once in the
> "configure" script and once in meson_options.txt. So let's add some logic to
> the configure script to read most of the help texts from meson_options.txt.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  configure | 95 ++++++++++++++++++-------------------------------------
>  1 file changed, 31 insertions(+), 64 deletions(-)
> 

> +
> +# Read remaining options and help text from meson_options.txt:
> +current_feature=""
> +while read first rest ; do
> +    case "$first" in
> +    option*)
> +        case "$rest" in
> +        *type*:*"'feature'"*)
> +            current_feature=${first%\'*}
> +            current_feature=${current_feature#*\'}
> +        ;;
> +        *)
> +            current_feature=""
> +        ;;
> +        esac
> +    ;;
> +    description:)
> +        if [ -n "$current_feature" ]; then
> +            rest=${rest%\'*}
> +            printf "  %-15s %s\n" "$current_feature" "${rest#\'}"
> +        fi
> +    ;;
> +    *)
> +        current_feature=""
> +    ;;
> +    esac
> +done < "$source_path/meson_options.txt" | sort

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]