git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] parse-options: align curly braces for all options
@ 2015-07-29 20:18 Stefan Beller
  2015-07-29 20:31 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Beller @ 2015-07-29 20:18 UTC (permalink / raw)
  To: gitster; +Cc: git, Stefan Beller

Signed-off-by: Stefan Beller <sbeller@google.com>
---

The non alignment of white space harmed my feelings for aesthetics more
than it should have.

 parse-options.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/parse-options.h b/parse-options.h
index c71e9da..08d7818 100644
--- a/parse-options.h
+++ b/parse-options.h
@@ -126,7 +126,7 @@ struct option {
 #define OPT_BOOL(s, l, v, h)        OPT_SET_INT(s, l, v, h, 1)
 #define OPT_HIDDEN_BOOL(s, l, v, h) { OPTION_SET_INT, (s), (l), (v), NULL, \
 				      (h), PARSE_OPT_NOARG | PARSE_OPT_HIDDEN, NULL, 1}
-#define OPT_CMDMODE(s, l, v, h, i) { OPTION_CMDMODE, (s), (l), (v), NULL, \
+#define OPT_CMDMODE(s, l, v, h, i)  { OPTION_CMDMODE, (s), (l), (v), NULL, \
 				      (h), PARSE_OPT_NOARG|PARSE_OPT_NONEG, NULL, (i) }
 #define OPT_INTEGER(s, l, v, h)     { OPTION_INTEGER, (s), (l), (v), N_("n"), (h) }
 #define OPT_STRING(s, l, v, a, h)   { OPTION_STRING,  (s), (l), (v), (a), (h) }
-- 
2.5.0.rc1.391.g15b60ce

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] parse-options: align curly braces for all options
  2015-07-29 20:18 [PATCH] parse-options: align curly braces for all options Stefan Beller
@ 2015-07-29 20:31 ` Junio C Hamano
  2015-07-29 21:36   ` Stefan Beller
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2015-07-29 20:31 UTC (permalink / raw)
  To: Stefan Beller; +Cc: git

Stefan Beller <sbeller@google.com> writes:

> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---
>
> The non alignment of white space harmed my feelings for aesthetics more
> than it should have.

Hmm, but this does not align curlies for OPT_DATE(),
OPT_EXPIRY_DATE(), etc...

>
>  parse-options.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/parse-options.h b/parse-options.h
> index c71e9da..08d7818 100644
> --- a/parse-options.h
> +++ b/parse-options.h
> @@ -126,7 +126,7 @@ struct option {
>  #define OPT_BOOL(s, l, v, h)        OPT_SET_INT(s, l, v, h, 1)
>  #define OPT_HIDDEN_BOOL(s, l, v, h) { OPTION_SET_INT, (s), (l), (v), NULL, \
>  				      (h), PARSE_OPT_NOARG | PARSE_OPT_HIDDEN, NULL, 1}
> -#define OPT_CMDMODE(s, l, v, h, i) { OPTION_CMDMODE, (s), (l), (v), NULL, \
> +#define OPT_CMDMODE(s, l, v, h, i)  { OPTION_CMDMODE, (s), (l), (v), NULL, \
>  				      (h), PARSE_OPT_NOARG|PARSE_OPT_NONEG, NULL, (i) }
>  #define OPT_INTEGER(s, l, v, h)     { OPTION_INTEGER, (s), (l), (v), N_("n"), (h) }
>  #define OPT_STRING(s, l, v, a, h)   { OPTION_STRING,  (s), (l), (v), (a), (h) }

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] parse-options: align curly braces for all options
  2015-07-29 20:31 ` Junio C Hamano
@ 2015-07-29 21:36   ` Stefan Beller
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Beller @ 2015-07-29 21:36 UTC (permalink / raw)
  To: gitster; +Cc: git, Stefan Beller

Signed-off-by: Stefan Beller <sbeller@google.com>
---

>> The non alignment of white space harmed my feelings for aesthetics more
>> than it should have.
>
> Hmm, but this does not align curlies for OPT_DATE(),
> OPT_EXPIRY_DATE(), etc...

That's true, but that was the least invasive fix to appease the aesthetics
as it was all nicely aligned in the beginning, then there was one outlier,
and it was nice again, at the end it is a mess.

Here is the another way to make it look nicer, though not minimally but rather
extensive.

 parse-options.h | 79 ++++++++++++++++++++++++++++-----------------------------
 1 file changed, 39 insertions(+), 40 deletions(-)

diff --git a/parse-options.h b/parse-options.h
index c71e9da..78e4462 100644
--- a/parse-options.h
+++ b/parse-options.h
@@ -111,46 +111,45 @@ struct option {
 	intptr_t defval;
 };
 
-#define OPT_END()                   { OPTION_END }
-#define OPT_ARGUMENT(l, h)          { OPTION_ARGUMENT, 0, (l), NULL, NULL, \
-				      (h), PARSE_OPT_NOARG}
-#define OPT_GROUP(h)                { OPTION_GROUP, 0, NULL, NULL, NULL, (h) }
-#define OPT_BIT(s, l, v, h, b)      { OPTION_BIT, (s), (l), (v), NULL, (h), \
-				      PARSE_OPT_NOARG, NULL, (b) }
-#define OPT_NEGBIT(s, l, v, h, b)   { OPTION_NEGBIT, (s), (l), (v), NULL, \
-				      (h), PARSE_OPT_NOARG, NULL, (b) }
-#define OPT_COUNTUP(s, l, v, h)     { OPTION_COUNTUP, (s), (l), (v), NULL, \
-				      (h), PARSE_OPT_NOARG }
-#define OPT_SET_INT(s, l, v, h, i)  { OPTION_SET_INT, (s), (l), (v), NULL, \
-				      (h), PARSE_OPT_NOARG, NULL, (i) }
-#define OPT_BOOL(s, l, v, h)        OPT_SET_INT(s, l, v, h, 1)
-#define OPT_HIDDEN_BOOL(s, l, v, h) { OPTION_SET_INT, (s), (l), (v), NULL, \
-				      (h), PARSE_OPT_NOARG | PARSE_OPT_HIDDEN, NULL, 1}
-#define OPT_CMDMODE(s, l, v, h, i) { OPTION_CMDMODE, (s), (l), (v), NULL, \
-				      (h), PARSE_OPT_NOARG|PARSE_OPT_NONEG, NULL, (i) }
-#define OPT_INTEGER(s, l, v, h)     { OPTION_INTEGER, (s), (l), (v), N_("n"), (h) }
-#define OPT_STRING(s, l, v, a, h)   { OPTION_STRING,  (s), (l), (v), (a), (h) }
-#define OPT_STRING_LIST(s, l, v, a, h) \
-				    { OPTION_CALLBACK, (s), (l), (v), (a), \
-				      (h), 0, &parse_opt_string_list }
-#define OPT_UYN(s, l, v, h)         { OPTION_CALLBACK, (s), (l), (v), NULL, \
-				      (h), PARSE_OPT_NOARG, &parse_opt_tertiary }
-#define OPT_DATE(s, l, v, h) \
-	{ OPTION_CALLBACK, (s), (l), (v), N_("time"),(h), 0,	\
-	  parse_opt_approxidate_cb }
-#define OPT_EXPIRY_DATE(s, l, v, h) \
-	{ OPTION_CALLBACK, (s), (l), (v), N_("expiry-date"),(h), 0,	\
-	  parse_opt_expiry_date_cb }
-#define OPT_CALLBACK(s, l, v, a, h, f) \
-	{ OPTION_CALLBACK, (s), (l), (v), (a), (h), 0, (f) }
-#define OPT_NUMBER_CALLBACK(v, h, f) \
-	{ OPTION_NUMBER, 0, NULL, (v), NULL, (h), \
-	  PARSE_OPT_NOARG | PARSE_OPT_NONEG, (f) }
-#define OPT_FILENAME(s, l, v, h)    { OPTION_FILENAME, (s), (l), (v), \
-				       N_("file"), (h) }
-#define OPT_COLOR_FLAG(s, l, v, h) \
-	{ OPTION_CALLBACK, (s), (l), (v), N_("when"), (h), PARSE_OPT_OPTARG, \
-		parse_opt_color_flag_cb, (intptr_t)"always" }
+#define OPT_END()                      { OPTION_END }
+#define OPT_ARGUMENT(l, h)             { OPTION_ARGUMENT, 0, (l), NULL, NULL, \
+					(h), PARSE_OPT_NOARG}
+#define OPT_GROUP(h)                   { OPTION_GROUP, 0, NULL, NULL, NULL, \
+					(h) }
+#define OPT_BIT(s, l, v, h, b)         { OPTION_BIT, (s), (l), (v), NULL, \
+					(h), PARSE_OPT_NOARG, NULL, (b) }
+#define OPT_NEGBIT(s, l, v, h, b)      { OPTION_NEGBIT, (s), (l), (v), NULL, \
+					(h), PARSE_OPT_NOARG, NULL, (b) }
+#define OPT_COUNTUP(s, l, v, h)        { OPTION_COUNTUP, (s), (l), (v), NULL, \
+					(h), PARSE_OPT_NOARG }
+#define OPT_SET_INT(s, l, v, h, i)     { OPTION_SET_INT, (s), (l), (v), NULL, \
+					(h), PARSE_OPT_NOARG, NULL, (i) }
+#define OPT_BOOL(s, l, v, h)           OPT_SET_INT(s, l, v, \
+					(h), 1)
+#define OPT_HIDDEN_BOOL(s, l, v, h)    { OPTION_SET_INT, (s), (l), (v), NULL, \
+					(h), PARSE_OPT_NOARG | PARSE_OPT_HIDDEN, NULL, 1}
+#define OPT_CMDMODE(s, l, v, h, i)     { OPTION_CMDMODE, (s), (l), (v), NULL, \
+					(h), PARSE_OPT_NOARG|PARSE_OPT_NONEG, NULL, (i) }
+#define OPT_INTEGER(s, l, v, h)        { OPTION_INTEGER, (s), (l), (v), N_("n"), \
+					(h) }
+#define OPT_STRING(s, l, v, a, h)      { OPTION_STRING,  (s), (l), (v), (a), \
+					(h) }
+#define OPT_STRING_LIST(s, l, v, a, h) { OPTION_CALLBACK, (s), (l), (v), (a), \
+					(h), 0, &parse_opt_string_list }
+#define OPT_UYN(s, l, v, h)            { OPTION_CALLBACK, (s), (l), (v), NULL, \
+					(h), PARSE_OPT_NOARG, &parse_opt_tertiary }
+#define OPT_DATE(s, l, v, h)           { OPTION_CALLBACK, (s), (l), (v), N_("time"), \
+					(h), 0, parse_opt_approxidate_cb }
+#define OPT_EXPIRY_DATE(s, l, v, h)    { OPTION_CALLBACK, (s), (l), (v), N_("expiry-date"), \
+					(h), 0, parse_opt_expiry_date_cb }
+#define OPT_CALLBACK(s, l, v, a, h, f) { OPTION_CALLBACK, (s), (l), (v), (a), \
+					(h), 0, (f) }
+#define OPT_NUMBER_CALLBACK(v, h, f)   { OPTION_NUMBER, 0, NULL, (v), NULL, \
+					(h), PARSE_OPT_NOARG | PARSE_OPT_NONEG, (f) }
+#define OPT_FILENAME(s, l, v, h)       { OPTION_FILENAME, (s), (l), (v), N_("file"), \
+					(h) }
+#define OPT_COLOR_FLAG(s, l, v, h)     { OPTION_CALLBACK, (s), (l), (v), N_("when"), \
+					(h), PARSE_OPT_OPTARG, parse_opt_color_flag_cb, (intptr_t)"always" }
 
 #define OPT_NOOP_NOARG(s, l) \
 	{ OPTION_CALLBACK, (s), (l), NULL, NULL, \
-- 
2.5.0.rc1.391.g15b60ce

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-29 21:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-29 20:18 [PATCH] parse-options: align curly braces for all options Stefan Beller
2015-07-29 20:31 ` Junio C Hamano
2015-07-29 21:36   ` Stefan Beller

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).