mirror of
https://codeberg.org/scip/epuppy.git
synced 2025-12-17 04:20:59 +01:00
Add dump feature, enhance code quality (#1)
This commit is contained in:
@@ -21,13 +21,13 @@ const (
|
||||
|
||||
Options:
|
||||
-D --dark enable dark mode
|
||||
-s --store-progress store and use previous (experimental)
|
||||
-s --store-progress remember reading position
|
||||
-n --line-numbers add line numbers
|
||||
-c --config <file> use config <file>
|
||||
-t --txt dump readable content to STDOUT
|
||||
-d --debug enable debugging
|
||||
-h --help show help message
|
||||
-v --version show program version
|
||||
`
|
||||
-v --version show program version`
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
@@ -36,6 +36,7 @@ type Config struct {
|
||||
StoreProgress bool `koanf:"store-progress"` // -s
|
||||
Darkmode bool `koanf:"dark"` // -D
|
||||
LineNumbers bool `koanf:"line-numbers"` // -n
|
||||
Dump bool `koanf:"txt"` // -t
|
||||
Config string `koanf:"config"` // -c
|
||||
ColorDark ColorSetting `koanf:"colordark"` // comes from config file only
|
||||
ColorLight ColorSetting `koanf:"colorlight"` // comes from config file only
|
||||
@@ -64,6 +65,7 @@ func InitConfig(output io.Writer) (*Config, error) {
|
||||
flagset.BoolP("dark", "D", false, "enable dark mode")
|
||||
flagset.BoolP("store-progress", "s", false, "store reading progress")
|
||||
flagset.BoolP("line-numbers", "n", false, "add line numbers")
|
||||
flagset.BoolP("txt", "t", false, "dump readable content to STDOUT")
|
||||
flagset.StringP("config", "c", "", "read config from file")
|
||||
|
||||
if err := flagset.Parse(os.Args[1:]); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user