{"thread":{"id":"51345","subject":"[PATCH] doc: improve usage string in MyFirstContribution","startedAt":"2019-06-19T22:13:43Z","lastAt":"2019-06-21T19:00:19Z","messageCount":6,"participants":["Christian Couder","Emily Shaffer","Eric Sunshine","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"377591","messageId":"20190619221315.7343-1-chriscool@tuxfamily.org","threadId":"51345","inReplyTo":null,"subject":"[PATCH] doc: improve usage string in MyFirstContribution","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2019-06-19T22:13:15Z","receivedAt":"2019-06-19T22:13:43Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"We implement a command called git-psuh which accept arguments, so let's\nshow that it accepts arguments in the doc and the usage string.\n\nWhile at it, we need to prepare \"a NULL-terminated array of usage strings\",\nnot just \"a NULL-terminated usage string\".\n\nSigned-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n Documentation/MyFirstContribution.txt | 12 +++++++-----\n 1 file changed, 7 insertions(+), 5 deletions(-)\n\ndiff --git a/Documentation/MyFirstContribution.txt b/Documentation/MyFirstContribution.txt\nindex 895b7cfd4f..7512a35ba3 100644\n--- a/Documentation/MyFirstContribution.txt\n+++ b/Documentation/MyFirstContribution.txt\n@@ -428,7 +428,7 @@ git-psuh - Delight users' typo with a shy horse\n SYNOPSIS\n --------\n [verse]\n-'git-psuh'\n+'git-psuh <arg>...'\n \n DESCRIPTION\n -----------\n@@ -491,14 +491,16 @@ Take a look at `Documentation/technical/api-parse-options.txt`. This is a handy\n tool for pulling out options you need to be able to handle, and it takes a\n usage string.\n \n-In order to use it, we'll need to prepare a NULL-terminated usage string and a\n-`builtin_psuh_options` array. Add a line to `#include \"parse-options.h\"`.\n+In order to use it, we'll need to prepare a NULL-terminated array of usage\n+strings and a `builtin_psuh_options` array.\n \n-At global scope, add your usage:\n+Add a line to `#include \"parse-options.h\"`.\n+\n+At global scope, add your array of usage strings:\n \n ----\n static const char * const psuh_usage[] = {\n-\tN_(\"git psuh\"),\n+\tN_(\"git psuh <arg>...\"),\n \tNULL,\n };\n ----\n-- \n2.22.0\n\n"},{"id":"377713","messageId":"20190620212922.GB87385@google.com","threadId":"51345","inReplyTo":"20190619221315.7343-1-chriscool@tuxfamily.org","subject":"Re: [PATCH] doc: improve usage string in MyFirstContribution","fromName":"Emily Shaffer","fromEmail":"emilyshaffer@google.com","sentAt":"2019-06-20T21:29:22Z","receivedAt":"2019-06-20T21:29:30Z","isPatch":true,"sender":{"key":"nasamuffin@google.com","avatar":"https://avatars.githubusercontent.com/u/1606826?v=4"},"body":"On Thu, Jun 20, 2019 at 12:13:15AM +0200, Christian Couder wrote:\n>  SYNOPSIS\n>  --------\n>  [verse]\n> -'git-psuh'\n> +'git-psuh <arg>...'\n\nIt doesn't require 1 or more args - you can run it with no args. So it\nmight be better suited to state the args as optional:\n\n  'git psuh [arg]...'\n\n>  ----\n>  static const char * const psuh_usage[] = {\n> -\tN_(\"git psuh\"),\n> +\tN_(\"git psuh <arg>...\"),\n\n...and here too.\n\n - Emily\n"},{"id":"377737","messageId":"CAP8UFD1KRq9gUJQbDP9d3xewS9F_9wHnt463Qt7UXoi7VdmOJg@mail.gmail.com","threadId":"51345","inReplyTo":"20190620212922.GB87385@google.com","subject":"Re: [PATCH] doc: improve usage string in MyFirstContribution","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2019-06-21T10:43:11Z","receivedAt":"2019-06-21T10:43:26Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Thu, Jun 20, 2019 at 11:29 PM Emily Shaffer <emilyshaffer@google.com> wrote:\n>\n> On Thu, Jun 20, 2019 at 12:13:15AM +0200, Christian Couder wrote:\n> >  SYNOPSIS\n> >  --------\n> >  [verse]\n> > -'git-psuh'\n> > +'git-psuh <arg>...'\n>\n> It doesn't require 1 or more args - you can run it with no args. So it\n> might be better suited to state the args as optional:\n>\n>   'git psuh [arg]...'\n>\n> >  ----\n> >  static const char * const psuh_usage[] = {\n> > -     N_(\"git psuh\"),\n> > +     N_(\"git psuh <arg>...\"),\n>\n> ...and here too.\n\nYeah sure, I will will resend soon with such changes.\n"},{"id":"377753","messageId":"CAPig+cQh0MC9JQPMkxhDKFzzCwRTC-_rVBR7RnzcP3SM_kn_vA@mail.gmail.com","threadId":"51345","inReplyTo":"CAP8UFD1KRq9gUJQbDP9d3xewS9F_9wHnt463Qt7UXoi7VdmOJg@mail.gmail.com","subject":"Re: [PATCH] doc: improve usage string in MyFirstContribution","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2019-06-21T16:37:59Z","receivedAt":"2019-06-21T16:38:13Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Fri, Jun 21, 2019 at 6:43 AM Christian Couder\n<christian.couder@gmail.com> wrote:\n> On Thu, Jun 20, 2019 at 11:29 PM Emily Shaffer <emilyshaffer@google.com> wrote:\n> > It doesn't require 1 or more args - you can run it with no args. So it\n> > might be better suited to state the args as optional:\n> >\n> >   'git psuh [arg]...'\n>\n> Yeah sure, I will will resend soon with such changes.\n\nMore correct would be \"git psuh [<arg>]\".\n"},{"id":"377755","messageId":"xmqqmuiakgaq.fsf@gitster-ct.c.googlers.com","threadId":"51345","inReplyTo":"CAPig+cQh0MC9JQPMkxhDKFzzCwRTC-_rVBR7RnzcP3SM_kn_vA@mail.gmail.com","subject":"Re: [PATCH] doc: improve usage string in MyFirstContribution","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-06-21T17:18:53Z","receivedAt":"2019-06-21T17:19:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Sunshine <sunshine@sunshineco.com> writes:\n\n> On Fri, Jun 21, 2019 at 6:43 AM Christian Couder\n> <christian.couder@gmail.com> wrote:\n>> On Thu, Jun 20, 2019 at 11:29 PM Emily Shaffer <emilyshaffer@google.com> wrote:\n>> > It doesn't require 1 or more args - you can run it with no args. So it\n>> > might be better suited to state the args as optional:\n>> >\n>> >   'git psuh [arg]...'\n>>\n>> Yeah sure, I will will resend soon with such changes.\n>\n> More correct would be \"git psuh [<arg>]\".\n\nI think this takes 0 or more, not 0 or 1, so \"git psuh [<arg>...]\",\nno?\n"},{"id":"377763","messageId":"CAPig+cQJRwfEnsPwY=Cwwy2zPU+=rd+5XJckh7=iEjsb2h1A7g@mail.gmail.com","threadId":"51345","inReplyTo":"xmqqmuiakgaq.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH] doc: improve usage string in MyFirstContribution","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2019-06-21T19:00:05Z","receivedAt":"2019-06-21T19:00:19Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Fri, Jun 21, 2019 at 1:19 PM Junio C Hamano <gitster@pobox.com> wrote:\n> Eric Sunshine <sunshine@sunshineco.com> writes:\n> > On Fri, Jun 21, 2019 at 6:43 AM Christian Couder\n> > <christian.couder@gmail.com> wrote:\n> >> On Thu, Jun 20, 2019 at 11:29 PM Emily Shaffer <emilyshaffer@google.com> wrote:\n> >> > It doesn't require 1 or more args - you can run it with no args. So it\n> >> > might be better suited to state the args as optional:\n> >> >\n> >> >   'git psuh [arg]...'\n> >>\n> >> Yeah sure, I will will resend soon with such changes.\n> >\n> > More correct would be \"git psuh [<arg>]\".\n>\n> I think this takes 0 or more, not 0 or 1, so \"git psuh [<arg>...]\",\n> no?\n\nI hadn't read the tutorial, but looking at it now, I see that it\nindeed takes zero or more, so \"git psuh [<arg>...]\" would be best.\n"}]}