pttodo-cli default file via env

v0.0.1
Bel LaPointe 2021-12-31 22:07:16 -05:00
parent 8c45d4a7df
commit f7dac79233
1 changed files with 5 additions and 1 deletions

View File

@ -22,7 +22,11 @@ func main() {
} }
func _main() error { func _main() error {
filepath := flag.String("f", "-", "path to yaml file") defaultFilepath, ok := os.LookupEnv("PTTODO_FILE")
if !ok {
defaultFilepath = "-"
}
filepath := flag.String("f", defaultFilepath, "($PTTODO_FILE) path to yaml file")
e := flag.Bool("e", false, "edit file") e := flag.Bool("e", false, "edit file")
flag.Parse() flag.Parse()
if *e { if *e {