Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-02-11 01:20:08 +0300
committerJunio C Hamano <gitster@pobox.com>2016-02-11 01:20:08 +0300
commit722c9244452c1853f0592b22c331382c282768c7 (patch)
tree51f432011324a752a2c57080e045a1fa7ad12c3f /builtin/ls-files.c
parent24abb31727e8e0b216bdee182dbbbbc43d134fa6 (diff)
parent1f3c79a9d6c3278753e7fb63b48569a9ff8632df (diff)
Merge branch 'jk/options-cleanup'
Various clean-ups to the command line option parsing. * jk/options-cleanup: apply, ls-files: simplify "-z" parsing checkout-index: disallow "--no-stage" option checkout-index: handle "--no-index" option checkout-index: handle "--no-prefix" option checkout-index: simplify "-z" option parsing give "nbuf" strbuf a more meaningful name
Diffstat (limited to 'builtin/ls-files.c')
-rw-r--r--builtin/ls-files.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/builtin/ls-files.c b/builtin/ls-files.c
index dedf02dc70..f02e3d23bb 100644
--- a/builtin/ls-files.c
+++ b/builtin/ls-files.c
@@ -379,14 +379,6 @@ static const char * const ls_files_usage[] = {
NULL
};
-static int option_parse_z(const struct option *opt,
- const char *arg, int unset)
-{
- line_terminator = unset ? '\n' : '\0';
-
- return 0;
-}
-
static int option_parse_exclude(const struct option *opt,
const char *arg, int unset)
{
@@ -428,9 +420,9 @@ int cmd_ls_files(int argc, const char **argv, const char *cmd_prefix)
struct exclude_list *el;
struct string_list exclude_list = STRING_LIST_INIT_NODUP;
struct option builtin_ls_files_options[] = {
- { OPTION_CALLBACK, 'z', NULL, NULL, NULL,
- N_("paths are separated with NUL character"),
- PARSE_OPT_NOARG, option_parse_z },
+ /* Think twice before adding "--nul" synonym to this */
+ OPT_SET_INT('z', NULL, &line_terminator,
+ N_("paths are separated with NUL character"), '\0'),
OPT_BOOL('t', NULL, &show_tag,
N_("identify the file status with tags")),
OPT_BOOL('v', NULL, &show_valid_bit,