git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2] doc: improve usage string in MyFirstContribution

From
Christian Couder <christian.couder@gmail.com>
Date
Jun 22, 2019, 06:10 UTC
Message-ID
<20190622061035.1612-1-chriscool@tuxfamily.org>

We implement a command called git-psuh which accept arguments, so let's show that it accepts arguments in the doc and the usage string.

While at it, we need to prepare "a NULL-terminated array of usage strings", not just "a NULL-terminated usage string".

Helped-by: Emily Shaffer <emilyshaffer@google.com>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---

The only change compared to he previous version is that "[<arg>...]" is used instead of "<arg>..." in the synopsis and help message as discussed with Emily, Eric and Junio.

 Documentation/MyFirstContribution.txt | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/Documentation/MyFirstContribution.txt b/Documentation/MyFirstContribution.txt
index 895b7cfd4f..f8670379c0 100644
--- a/Documentation/MyFirstContribution.txt
+++ b/Documentation/MyFirstContribution.txt
@@ -428,7 +428,7 @@ git-psuh - Delight users' typo with a shy horse
 SYNOPSIS
 --------
 [verse]
-'git-psuh'
+'git-psuh [<arg>...]'
 
 DESCRIPTION
 -----------
@@ -491,14 +491,16 @@ Take a look at `Documentation/technical/api-parse-options.txt`. This is a handy
 tool for pulling out options you need to be able to handle, and it takes a
 usage string.
 
-In order to use it, we'll need to prepare a NULL-terminated usage string and a
-`builtin_psuh_options` array. Add a line to `#include "parse-options.h"`.
+In order to use it, we'll need to prepare a NULL-terminated array of usage
+strings and a `builtin_psuh_options` array.
 
-At global scope, add your usage:
+Add a line to `#include "parse-options.h"`.
+
+At global scope, add your array of usage strings:
 
 ----
 static const char * const psuh_usage[] = {
-	N_("git psuh"),
+	N_("git psuh [<arg>...]"),
 	NULL,
 };
 ----
-- 
2.22.0.206.geb73f2e638
Message 1 of 1 in “doc: improve usage string in MyFirstContribution”
  1. doc: improve usage string in MyFirstContributionChristian Couder, Jun 22, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.