Re: [PATCH 2/9] test-mergesort: add sort subcommand

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

 



René Scharfe <l.s.r@xxxxxx> writes:

> Give the code for sorting a text file its own sub-command.  This allows
> extending the helper, which we'll do in the following patches.
> ...
> -int cmd__mergesort(int argc, const char **argv)
> +static int sort_stdin(void)
>  {
>  	struct line *line, *p = NULL, *lines = NULL;
>  	struct strbuf sb = STRBUF_INIT;
> @@ -49,3 +49,10 @@ int cmd__mergesort(int argc, const char **argv)
>  	}
>  	return 0;
>  }
> +
> +int cmd__mergesort(int argc, const char **argv)
> +{
> +	if (argc == 2 && !strcmp(argv[1], "sort"))
> +		return sort_stdin();
> +	usage("test-tool mergesort sort");
> +}

This smelled funny, as it would certainly have broken any existing
script in t/ that were using "test-tool mergesort <input".

But "git grep mergesort master -- t/" reveals that nobody uses it,
so we are safe ;-)





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux