Re: [PATCH v2 13/17] ls: add -1 short for --no-column in the spirit of GNU ls

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

 



On Wed, Mar 26, 2014 at 9:48 AM, Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> wrote:
> Subject: ls: add -1 short for --no-column in the spirit of GNU ls

The -1 option is POSIX [1]; not a GNU extension.

[1]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ls.html

> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx>
> ---
>  Documentation/git-ls.txt | 3 +++
>  builtin/ls-files.c       | 2 ++
>  2 files changed, 5 insertions(+)
>
> diff --git a/Documentation/git-ls.txt b/Documentation/git-ls.txt
> index 10df6b0..0480c42 100644
> --- a/Documentation/git-ls.txt
> +++ b/Documentation/git-ls.txt
> @@ -51,6 +51,9 @@ OPTIONS
>  --recursive::
>         Equivalent of --max-depth=-1 (infinite recursion).
>
> +-1::
> +       Equivalent of --no-column.
> +
>  --color[=<when>]::
>         Color file names. The value must be always (default), never,
>         or auto.
> diff --git a/builtin/ls-files.c b/builtin/ls-files.c
> index 772a6ce..014de05 100644
> --- a/builtin/ls-files.c
> +++ b/builtin/ls-files.c
> @@ -729,6 +729,8 @@ int cmd_ls(int argc, const char **argv, const char *cmd_prefix)
>                             N_("shortcut for --max-depth=-1"), -1),
>                 OPT__COLOR(&use_color, N_("show color")),
>                 OPT_COLUMN(0, "column", &colopts, N_("show files in columns")),
> +               OPT_SET_INT('1', NULL, &colopts,
> +                           N_("shortcut for --no-column"), COL_PARSEOPT),
>                 { OPTION_INTEGER, 0, "max-depth", &max_depth, N_("depth"),
>                         N_("descend at most <depth> levels"), PARSE_OPT_NONEG,
>                         NULL, 1 },
> --
> 1.9.1.345.ga1a145c
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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]