[PATCH xkbcomp] Print version number on -version.

Alan Coopersmith alan.coopersmith at oracle.com
Tue Jun 21 17:53:15 PDT 2011


On 06/21/11 05:46 PM, Peter Hutterer wrote:
> This commit isn't playing the WARN/M/M1 macro game. Version numbers to to
> stdout, full stop.
> 
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> ---
>  xkbcomp.c |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
> 
> diff --git a/xkbcomp.c b/xkbcomp.c
> index 892062f..2a3e8f4 100644
> --- a/xkbcomp.c
> +++ b/xkbcomp.c
> @@ -119,6 +119,7 @@ Usage(int argc, char *argv[])
>          M1("Usage: %s [options] file[(map)] ...\n", argv[0]);
>      M("Legal options:\n");
>      M("-?,-help             Print this message\n");
> +    M("-version             Print the version number\n");
>      if (!xkblist)
>      {
>          M("-a                   Show all actions\n");
> @@ -252,7 +253,11 @@ parseArgs(int argc, char *argv[])
>              Usage(argc, argv);
>              exit(0);
>          }
> -        else if ((strcmp(argv[i], "-a") == 0) && (!xkblist))
> +        else if (strcmp(argv[i], "-version") == 0)
> +        {
> +            printf("xkbcomp %s\n", PACKAGE_VERSION);
> +            exit(0);
> +        } else if ((strcmp(argv[i], "-a") == 0) && (!xkblist))
>          {
>              showImplicit = True;
>          }

Shouldn't it be added to the man page option list too?

-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System



More information about the xorg-devel mailing list