"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Omar Polo <op@omarpolo.com>
Subject:
Re: got{,admin}.1 and tog.1: fix usage
To:
Omar Polo <op@omarpolo.com>
Cc:
gameoftrees@openbsd.org
Date:
Sun, 02 Oct 2022 17:15:17 +0200

Download raw body.

Thread
On 2022/10/02 16:55:38 +0200, Omar Polo <op@omarpolo.com> wrote:
> As the manpage states, `-h' and `-V' (or --version) must be given
> before the command.  Actually, when using the flags the command is
> actually optional.
> 
> 	% got cat -h
> 	got: unknown option -- h
> 	usage: got cat [-P] [-c commit] [-r repository-path] arg ...
> 	% got -h cat
> 	usage: got cat [-P] [-c commit] [-r repository-path] arg ...
> 
> ok?

woops, forgot to look at what the various usage() do.  Updated diff
that syncs those too.

diff /home/op/w/got
commit - e02b422b6f7736de0e851b3f8fad812e77e9c6b4
path + /home/op/w/got
blob - 3c54a78702c5a0acbe54c9948029dcd3ebba2ccc
file + got/got.1
--- got/got.1
+++ got/got.1
@@ -22,9 +22,11 @@
 .Nd Game of Trees
 .Sh SYNOPSIS
 .Nm
+.Op Fl hV
+.Oo
 .Ar command
-.Op Fl h
 .Op Ar arg ...
+.Oc
 .Sh DESCRIPTION
 .Nm
 is a version control system which stores the history of tracked files
blob - 2fe9e120a0bace5a7b80643b8da00a79f1462de8
file + got/got.c
--- got/got.c
+++ got/got.c
@@ -281,7 +281,7 @@ usage(int hflag, int status)
 {
 	FILE *fp = (status == 0) ? stdout : stderr;
 
-	fprintf(fp, "usage: %s [-h] [-V | --version] command [arg ...]\n",
+	fprintf(fp, "usage: %s [-hV] [command [arg ...]]\n",
 	    getprogname());
 	if (hflag)
 		list_commands(fp);
blob - c633b3177963aca3fa00f1a3474129c3b4441c1b
file + gotadmin/gotadmin.1
--- gotadmin/gotadmin.1
+++ gotadmin/gotadmin.1
@@ -21,9 +21,11 @@
 .Nd Game of Trees repository administration
 .Sh SYNOPSIS
 .Nm
+.Op Fl hV
+.Oo
 .Ar command
-.Op Fl h
 .Op Ar arg ...
+.Oc
 .Sh DESCRIPTION
 .Nm
 is the repository maintenance tool for the
blob - 075ff5086825e3041fdc58673e8adca7e6016635
file + gotadmin/gotadmin.c
--- gotadmin/gotadmin.c
+++ gotadmin/gotadmin.c
@@ -195,7 +195,7 @@ usage(int hflag, int status)
 {
 	FILE *fp = (status == 0) ? stdout : stderr;
 
-	fprintf(fp, "usage: %s [-h] [-V | --version] command [arg ...]\n",
+	fprintf(fp, "usage: %s [-hV] [command [arg ...]]\n",
 	    getprogname());
 	if (hflag)
 		list_commands(fp);
blob - c3488dc79dfbff68596199641118d5f73ffdc650
file + tog/tog.1
--- tog/tog.1
+++ tog/tog.1
@@ -21,9 +21,11 @@
 .Nd Git repository browser
 .Sh SYNOPSIS
 .Nm
-.Op Ar command
-.Op Fl h
+.Op Fl hV
+.Oo
+.Ar command
 .Op Ar arg ...
+.Oc
 .Pp
 .Nm
 .Ar path
blob - 9342533704886cb6d5da04a9e2323e418557f8a8
file + tog/tog.c
--- tog/tog.c
+++ tog/tog.c
@@ -9132,7 +9132,7 @@ usage(int hflag, int status)
 {
 	FILE *fp = (status == 0) ? stdout : stderr;
 
-	fprintf(fp, "usage: %s [-h] [-V | --version] [command] [arg ...]\n",
+	fprintf(fp, "usage: %s [-hV] [command [arg ...]]\n",
 	    getprogname());
 	if (hflag) {
 		fprintf(fp, "lazy usage: %s path\n", getprogname());