Re: [PATCH 2] count-objects: add human-readable size option

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

 



Marcus Griep, Thu, Aug 14, 2008 16:03:22 +0200:
> Alex Riesen wrote:
> > GNU ls and du use "-h", with du using -H for SI units.
> 
> git's parse options plays interference here and injects the usage
> and exits if it finds the '-h' option.  Is there a way to get around
> that?

AFAICS - no. I'd suggest removing "-h" from the unconditionally
reserved list of options (untested patch attached). "--help" is well
known (which could be a reason why coreutils uses just it).

On somewhat similar note, how about be a bit _less_ user-friendly in
the text messages? IOW, make things like "something didn't work,
please try doing 'git something-else'" configurable (ok, active by
default, by deactivatable). These take an awful lot of screen space.
The builtin fetch, checkout, add (the most often used commands) are
the chattiest. The text in commit buffer takes almost half of screen,
too.

--

diff --git a/parse-options.c b/parse-options.c
index fd08bb4..7f85cd7 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -267,8 +267,6 @@ int parse_options_step(struct parse_opt_ctx_t *ctx,
 
 		if (arg[1] != '-') {
 			ctx->opt = arg + 1;
-			if (*ctx->opt == 'h')
-				return parse_options_usage(usagestr, options);
 			switch (parse_short_opt(ctx, options)) {
 			case -1:
 				return parse_options_usage(usagestr, options);
@@ -278,8 +276,6 @@ int parse_options_step(struct parse_opt_ctx_t *ctx,
 			if (ctx->opt)
 				check_typos(arg + 1, options);
 			while (ctx->opt) {
-				if (*ctx->opt == 'h')
-					return parse_options_usage(usagestr, options);
 				switch (parse_short_opt(ctx, options)) {
 				case -1:
 					return parse_options_usage(usagestr, options);
--
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]

  Powered by Linux