forked from sloum/bombadillo
Merge branch 'command-line-cleanup' of asdf/bombadillo into develop
This commit is contained in:
commit
24e2509831
|
@ -1,4 +1,4 @@
|
|||
# Bombadillo
|
||||
# Bombadillo - a non-web client
|
||||
|
||||
Bombadillo is a modern [Gopher](https://en.wikipedia.org/wiki/Gopher_(protocol)) client for the terminal, and functions as a pager/terminal UI. Bombadillo features vim-like keybindings, configurable settings, and a robust command selection. Bombadillo is under active development.
|
||||
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
.SH SYNOPSIS
|
||||
.nf
|
||||
.fam C
|
||||
\fBbombadillo\fP [\fB-v\fP] [\fB-h\fP] [\fIurl\fP]
|
||||
\fBbombadillo\fP [\fIurl\fP]
|
||||
\fBbombadillo\fP [\fBOPTION\fP]
|
||||
.fam T
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
|
@ -13,7 +14,7 @@
|
|||
.TP
|
||||
.B
|
||||
\fB-v\fP
|
||||
Display the version number of \fBbombadillo\fP.
|
||||
Display version information and exit.
|
||||
.TP
|
||||
.B
|
||||
\fB-h\fP
|
||||
|
|
23
main.go
23
main.go
|
@ -112,7 +112,7 @@ func loadConfig() error {
|
|||
if lowerkey == "configlocation" {
|
||||
// The config defaults to the home folder.
|
||||
// Users cannot really edit this value. But
|
||||
// a compile time override is available.
|
||||
// a compile time override is available.
|
||||
// It is still stored in the ini and as a part
|
||||
// of the options map.
|
||||
continue
|
||||
|
@ -161,11 +161,28 @@ func handleSIGCONT(c <-chan os.Signal) {
|
|||
}
|
||||
}
|
||||
|
||||
//printHelp produces a nice display message when the --help flag is used
|
||||
func printHelp() {
|
||||
art := `Bombadillo - a non-web client
|
||||
|
||||
Syntax: bombadillo [url]
|
||||
bombadillo [options...]
|
||||
|
||||
Examples: bombadillo gopher://bombadillo.colorfield.space
|
||||
bombadillo -v
|
||||
|
||||
Options:
|
||||
`
|
||||
fmt.Fprint(os.Stdout, art)
|
||||
flag.PrintDefaults()
|
||||
}
|
||||
|
||||
func main() {
|
||||
getVersion := flag.Bool("v", false, "See version number")
|
||||
getVersion := flag.Bool("v", false, "Display version information and exit")
|
||||
flag.Usage = printHelp
|
||||
flag.Parse()
|
||||
if *getVersion {
|
||||
fmt.Printf("Bombadillo %s\n", version)
|
||||
fmt.Printf("Bombadillo %s - build %s\n", version, build)
|
||||
os.Exit(0)
|
||||
}
|
||||
args := flag.Args()
|
||||
|
|
Loading…
Reference in New Issue