View Single Post
Old 07-18-2018, 09:48 AM   #141
geek1011
Wizard
geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.
 
Posts: 2,808
Karma: 7423683
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
Quote:
Originally Posted by norbusan View Post
Do you prefer the external pflag or the golang internal flag library? Syntax-wise they seem to be rather close.

Adding some command line parsing I would switch to specifying the config yaml via an extra cmd line flag instead of a normal argument?

E.g.
Code:
  kobopatch [--config SomeConfig.yaml] [--firmware PathToFirmware.zip]
WDYT?
I prefer pflag (spf13's fork), as it has better help, supports sort flags, and uses 2 dashes for long flags. Have a look at this to see how I usually implement flags in my apps.

I'd keep the config as a positional argument so Windows users can drag and drop a config file.
geek1011 is online now   Reply With Quote