diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e1e75f..4c3eeeb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Option to continue anyway when cert doesn't match TOFU database - Display all `text/*` documents, not just gemini and plain (#12) - Prefer XDG environment variables if they're set, to specify config dir, etc (#11) +- Version and help commands - `-v`, `--version`, `--help`, `-h` (#14) ### Changed - Connection timeout is 15 seconds (was 5s) diff --git a/NOTES.md b/NOTES.md index 21f747c..7cdbe8e 100644 --- a/NOTES.md +++ b/NOTES.md @@ -10,4 +10,6 @@ - Filed [issue 25](https://gitlab.com/tslocum/cview/-/issues/25) - Modal styling messed up when wrapped - example occurence is the error modal for a long unsupported scheme URL - Filed [issue 26](https://gitlab.com/tslocum/cview/-/issues/26) - - Add some bold back into modal text after this is fixed \ No newline at end of file + - Add some bold back into modal text after this is fixed +- Bookmark keys aren't deleted, just set to "" + - Waiting on [this viper PR](https://github.com/spf13/viper/pull/519) to be merged \ No newline at end of file diff --git a/amfora.go b/amfora.go index 4476da8..d92a5b9 100644 --- a/amfora.go +++ b/amfora.go @@ -1,18 +1,33 @@ package main import ( + "fmt" "os" "github.com/makeworld-the-better-one/amfora/config" "github.com/makeworld-the-better-one/amfora/display" ) +var version = "1.2.0" + func main() { // err := logger.Init() // if err != nil { // panic(err) // } + if len(os.Args) > 1 { + if os.Args[1] == "--version" || os.Args[1] == "-v" { + fmt.Println(version) + return + } + if os.Args[1] == "--help" || os.Args[1] == "-h" { + fmt.Println("Amfora is a fancy terminal browser for the Gemini protocol.\r\n") + fmt.Println("Usage:\r\namfora [URL]\r\namfora --version, -v") + return + } + } + err := config.Init() if err != nil { panic(err)