mirror of
https://codeberg.org/scip/epuppy.git
synced 2025-12-17 04:20:59 +01:00
add line number support and support for text files
This commit is contained in:
@@ -17,7 +17,17 @@ import (
|
||||
|
||||
const (
|
||||
Version string = `v0.0.2`
|
||||
Usage string = `epuppy [-vd] <epub file>`
|
||||
Usage string = `Usage epuppy [options] <epub file>
|
||||
|
||||
Options:
|
||||
-D --dark enable dark mode
|
||||
-s --store-progress store and use previous (experimental)
|
||||
-n --line-numbers add line numbers
|
||||
-c --config <file> use config <file>
|
||||
-d --debug enable debugging
|
||||
-h --help show help message
|
||||
-v --version show program version
|
||||
`
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
@@ -25,6 +35,7 @@ type Config struct {
|
||||
Debug bool `koanf:"debug"` // -d
|
||||
StoreProgress bool `koanf:"store-progress"` // -s
|
||||
Darkmode bool `koanf:"dark"` // -D
|
||||
LineNumbers bool `koanf:"line-numbers"` // -n
|
||||
Config string `koanf:"config"` // -c
|
||||
ColorDark ColorSetting `koanf:"colordark"` // comes from config file only
|
||||
ColorLight ColorSetting `koanf:"colorlight"` // comes from config file only
|
||||
@@ -52,6 +63,7 @@ func InitConfig(output io.Writer) (*Config, error) {
|
||||
flagset.BoolP("debug", "d", false, "enable debugging")
|
||||
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.StringP("config", "c", "", "read config from file")
|
||||
|
||||
if err := flagset.Parse(os.Args[1:]); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user