[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [PATCH] Add support for long options to cmp
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2022-01-23 19:27:12
Message-ID: CAK1hOcMog6CDC8=T7eQBLHMZKN=NTOHdSgwN=a4MMadTUsGukQ () mail ! gmail ! com
[Download RAW message or body]

Applied, thank you.

On Fri, Jan 21, 2022 at 3:00 PM Walter Lozano
<walter.lozano@collabora.com> wrote:
>
> In order to improve compatibility with GNU cmp add support for long
> options to busybox cmp.
>
> Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
> ---
>  editors/cmp.c | 15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/editors/cmp.c b/editors/cmp.c
> index 6d2b0c6c3..6eaed59fe 100644
> --- a/editors/cmp.c
> +++ b/editors/cmp.c
> @@ -54,12 +54,25 @@ int cmp_main(int argc UNUSED_PARAM, char **argv)
>         int retval = 0;
>         int max_count = -1;
>
> -       opt = getopt32(argv, "^"
> +#if ENABLE_LONG_OPTS
> +       static const char cmp_longopts[] ALIGN1 =
> +               "bytes\0"          Required_argument  "n"
> +               "quiet\0"          No_argument        "s"
> +               "silent\0"         No_argument        "s"
> +               "verbose\0"        No_argument        "l"
> +               ;
> +# define LONGOPTS cmp_longopts
> +#else
> +# define LONGOPTS NULL
> +#endif
> +
> +       opt = getopt32long(argv, "^"
>                         OPT_STR
>                         "\0" "-1"
>                         IF_DESKTOP(":?4")
>                         IF_NOT_DESKTOP(":?2")
>                         ":l--s:s--l",
> +                       LONGOPTS,
>                         &max_count
>         );
>         argv += optind;
> --
> 2.25.1
>
> _______________________________________________
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic