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

[PATCH] Fixing --help, usage for *-id

From
PRPavel Roskin <proski@gnu.org>
Date
Sep 19, 2005, 21:29 UTC
Message-ID
<1127165381.26772.16.camel@dv>
Hello!

Removal of cg-Xlib inclusion in *-id scripts broke "--help" switch. When cg-Xlib is sourced indirectly through cg-Xnormid, the help text is treated like an ID, and its last word is dropped.

Lack of USAGE string in the *-id scripts breaks the documentation generation because empty synopsis causes invalid XML. Thus the USAGE strings should be provided.

Signed-off-by: Pavel Roskin <proski@gnu.org>
diff --git a/cg-commit-id b/cg-commit-id
--- a/cg-commit-id
+++ b/cg-commit-id
@@ -5,6 +5,10 @@
 #
 # Takes the appropriate ID, defaults to HEAD.
 
+USAGE="cg-commit-id"
+
+. ${COGITO_LIB}cg-Xlib
+
 id="$1"
 normid=$(. ${COGITO_LIB}cg-Xnormid "$id") || exit 1
 type=${normid#* }
diff --git a/cg-parent-id b/cg-parent-id
--- a/cg-parent-id
+++ b/cg-parent-id
@@ -7,5 +7,9 @@
 #
 # NOTE: Will return multiple SHA1s if ID is a commit with multiple parents.
 
+USAGE="cg-parent-id"
+
+. ${COGITO_LIB}cg-Xlib
+
 normid=$(. ${COGITO_LIB}cg-Xnormid "$1"^)
 echo ${normid%% *}
diff --git a/cg-tree-id b/cg-tree-id
--- a/cg-tree-id
+++ b/cg-tree-id
@@ -5,6 +5,10 @@
 #
 # Takes ID of the appropriate commit, defaults to HEAD.
 
+USAGE="cg-tree-id"
+
+. ${COGITO_LIB}cg-Xlib
+
 id="$1"
 normid=$(. ${COGITO_LIB}cg-Xnormid "$id") || exit 1
 type=${normid#* }
-- 
Regards,
Pavel Roskin
Next: Petr Baudis
Message 1 of 2 in “Fixing --help, usage for *-id”
  1. Fixing --help, usage for *-idPavel Roskin, Sep 19, 2005
  2. Petr BaudisSep 19, 2005

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.