1
0
mirror of https://github.com/makew0rld/amfora.git synced 2024-06-25 19:55:22 +00:00

Add version and help commands - fixes #14

This commit is contained in:
makeworld 2020-06-23 20:23:28 -04:00
parent cfe58cb5f3
commit 4eea75edeb
3 changed files with 19 additions and 1 deletions

View File

@ -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 - Option to continue anyway when cert doesn't match TOFU database
- Display all `text/*` documents, not just gemini and plain (#12) - Display all `text/*` documents, not just gemini and plain (#12)
- Prefer XDG environment variables if they're set, to specify config dir, etc (#11) - Prefer XDG environment variables if they're set, to specify config dir, etc (#11)
- Version and help commands - `-v`, `--version`, `--help`, `-h` (#14)
### Changed ### Changed
- Connection timeout is 15 seconds (was 5s) - Connection timeout is 15 seconds (was 5s)

View File

@ -11,3 +11,5 @@
- Modal styling messed up when wrapped - example occurence is the error modal for a long unsupported scheme URL - 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) - Filed [issue 26](https://gitlab.com/tslocum/cview/-/issues/26)
- Add some bold back into modal text after this is fixed - 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

View File

@ -1,18 +1,33 @@
package main package main
import ( import (
"fmt"
"os" "os"
"github.com/makeworld-the-better-one/amfora/config" "github.com/makeworld-the-better-one/amfora/config"
"github.com/makeworld-the-better-one/amfora/display" "github.com/makeworld-the-better-one/amfora/display"
) )
var version = "1.2.0"
func main() { func main() {
// err := logger.Init() // err := logger.Init()
// if err != nil { // if err != nil {
// panic(err) // 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() err := config.Init()
if err != nil { if err != nil {
panic(err) panic(err)