Skip to content

Commit fec5406

Browse files
committed
- [*] enable UsageSummary
1 parent af07c1a commit fec5406

4 files changed

Lines changed: 11 additions & 2 deletions

File tree

OpenSesame_cli.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ StructName: Options
99
StructVar: Opts
1010

1111
# Whether to use the USAGE_SUMMARY in Usage help
12-
UsageSummary: ""
12+
UsageSummary: "TRUE"
1313

1414
UsageLead: "\\nUsage:\\n %s [flags..]\\n\\nFlags:\\n\\n"
1515

OpenSesame_cliDef.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,14 @@ func init() {
5353

5454
}
5555

56+
const USAGE_SUMMARY = " -port\tlistening port (OPENSESAME_PORT)\n -path\tpath to serve files from (OPENSESAME_PATH)\n -help\tshow usage help (OPENSESAME_HELP)\n\nDetails:\n\n"
57+
5658
// Usage function shows help on commandline usage
5759
func Usage() {
5860
fmt.Fprintf(os.Stderr,
5961
"\nUsage:\n %s [flags..]\n\nFlags:\n\n",
6062
progname)
63+
fmt.Fprintf(os.Stderr, USAGE_SUMMARY)
6164
flag.PrintDefaults()
6265
fmt.Fprintf(os.Stderr,
6366
"\nWill serve the files from the given path via web server\nof the given port using a one-time random path.\n\nExit and restart will serve from another random path.\n\nThe `-port` / `-path` can be overridden by environment variable(s)\n `OPENSESAME_PORT` / `OPENSESAME_PATH`\n")

OpenSesame_main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package main
22

3-
//go:generate sh -v OpenSesame_cliGen.sh
3+
//go:generate sh OpenSesame_cliGen.sh
44

55
import (
66
"flag"

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ Usage:
2121

2222
Flags:
2323

24+
-port listening port (OPENSESAME_PORT)
25+
-path path to serve files from (OPENSESAME_PATH)
26+
-help show usage help
27+
28+
Details:
29+
2430
-help
2531
show usage help
2632
-path string

0 commit comments

Comments
 (0)