Skip to content

Commit

Permalink
Update readme help text
Browse files Browse the repository at this point in the history
  • Loading branch information
dpb587 committed Jun 21, 2020
1 parent cd90159 commit 5a7d19a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,14 @@ Use the `blob` type to download individual repository files. Branch and commit r
gget --type=blob github.com/stedolan/[email protected] README.md

Use `--help` to see all options and learn more about advanced usage.

Usage:
gget HOST/OWNER/REPOSITORY[@REF] [LOCAL-PATH=]RESOURCE-GLOB...
gget HOST/OWNER/REPOSITORY[@REF] [[LOCAL-PATH=]RESOURCE-GLOB...]

Runtime Options:
-q, --quiet suppress runtime status reporting
-v, --verbose increase logging verbosity (multiple)
-h, --help show documentation of this command
--version=[CONSTRAINT] show version of this command (optionally verifying a constraint)
--version=[CONSTRAINT] show version of this command (with optional constraint to validate)

Repository Options:
--service=NAME specific git service to use (values: github, gitlab; default: auto-detect)
Expand Down Expand Up @@ -133,9 +132,9 @@ When downloading files, `gget` attempts to validate checksums when they are foun

* Algorithms: `sha512`, `sha256`, `sha1`, `md5`
* Format:
* `*sum` command output -- `{checksum} {file}`
* `*sum` command output - `{checksum} {file}`
* Sources:
* release notes -- code block or code fence
* release notes - code block or code fence
* sibling files with an algorithm suffix (case-insensitive) - `*.{algorithm}`
* checksum list files (case-insensitive) - `checksum`, `checksums`, `*checksums.txt`, `{algorithm}sum.txt`, `{algorithm}sums.txt`

Expand Down
13 changes: 10 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,17 @@ func main() {
if err != nil {
fatal(err)
} else if cmd.Runtime.Help {
buf := &bytes.Buffer{}
parser.WriteHelp(buf)
helpBuf := &bytes.Buffer{}
parser.WriteHelp(helpBuf)
help := helpBuf.String()

fmt.Print(strings.Replace(buf.String(), ") (", "; ", -1))
// imply origin is required (optional to support --version, -h)
help = strings.Replace(help, "[HOST/OWNER/REPOSITORY[@REF]]", "HOST/OWNER/REPOSITORY[@REF]", -1)

// join conventional paren groups
help = strings.Replace(help, ") (", "; ", -1)

fmt.Print(help)
fmt.Printf("\n")

return
Expand Down

0 comments on commit 5a7d19a

Please sign in to comment.