{"thread":{"id":"7490","subject":"[PATCH 2/3] Human friendly git: accept human readable options.","startedAt":"2007-04-01T00:00:00Z","lastAt":"2007-04-01T00:00:00Z","messageCount":1,"participants":["Sloof Lirpa"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"38455","messageId":"7vlkhd557f.fsf@assigned-by-dhcp.cox.net","threadId":"7490","inReplyTo":null,"subject":"[PATCH 2/3] Human friendly git: accept human readable options.","fromName":"Sloof Lirpa","fromEmail":"sitemaster@cox.net","sentAt":"2007-04-01T00:00:00Z","receivedAt":"2007-04-01T00:00:00Z","isPatch":true,"sender":{"key":"sitemaster@cox.net","avatar":null},"body":"In kindergarten, we were taught to say \"please\" when asking\nanother person to do something for us.  With this, git\nunderstands:\n\n\t$ git, please commit\n\nSigned-off-by: Sloof Lirpa <sitemaster@cox.net>\n---\n git.c |   14 +++++++++++---\n 1 files changed, 11 insertions(+), 3 deletions(-)\n\ndiff --git a/git.c b/git.c\nindex 5b1bc2a..7909fd3 100644\n--- a/git.c\n+++ b/git.c\n@@ -34,7 +34,15 @@ static int handle_options(const char*** argv, int* argc)\n \n \twhile (*argc > 0) {\n \t\tconst char *cmd = (*argv)[0];\n-\t\tif (cmd[0] != '-')\n+\n+\t\t/*\n+\t\t * Additional \"human friendly\" options do not begin\n+\t\t * with '-'.\n+\t\t */\n+\t\tif (!strcmp(cmd, \"please\"))\n+\t\t\t; /* no-op */\n+\n+\t\telse if (cmd[0] != '-')\n \t\t\tbreak;\n \n \t\t/*\n@@ -42,13 +50,13 @@ static int handle_options(const char*** argv, int* argc)\n \t\t * commands can be written with \"--\" prepended\n \t\t * to make them look like flags.\n \t\t */\n-\t\tif (!strcmp(cmd, \"--help\") || !strcmp(cmd, \"--version\"))\n+\t\telse if (!strcmp(cmd, \"--help\") || !strcmp(cmd, \"--version\"))\n \t\t\tbreak;\n \n \t\t/*\n \t\t * Check remaining flags.\n \t\t */\n-\t\tif (!prefixcmp(cmd, \"--exec-path\")) {\n+\t\telse if (!prefixcmp(cmd, \"--exec-path\")) {\n \t\t\tcmd += 11;\n \t\t\tif (*cmd == '=')\n \t\t\t\tgit_set_exec_path(cmd + 1);\n-- \n1.5.1.rc3.26.g4f01\n"}]}