diff --git a/generate.go b/generate.go index 2e82731..bdd17d9 100644 --- a/generate.go +++ b/generate.go @@ -16,7 +16,7 @@ import ( ) type GenerateCommand struct { - fs *flag.FlagSet + *flag.FlagSet input string output string employmentHistory int @@ -24,24 +24,16 @@ type GenerateCommand struct { func NewGenerateCommand() *GenerateCommand { gc := GenerateCommand{ - fs: flag.NewFlagSet("generate", flag.ExitOnError), + FlagSet: flag.NewFlagSet("generate", flag.ExitOnError), } - gc.fs.StringVar(&gc.input, "input", "", "specify the CV JSON file that you want to input to the builder.") - gc.fs.StringVar(&gc.output, "output", "", "specify the name of the output CV file.") - gc.fs.IntVar(&gc.employmentHistory, "employment-history", 10, "show employment history within these number of years.") + gc.StringVar(&gc.input, "input", "", "specify the CV JSON file that you want to input to the builder.") + gc.StringVar(&gc.output, "output", "", "specify the name of the output CV file.") + gc.IntVar(&gc.employmentHistory, "employment-history", 10, "show employment history within these number of years.") return &gc } -func (g *GenerateCommand) Parse(args []string) error { - return g.fs.Parse(args) -} - -func (g *GenerateCommand) Name() string { - return g.fs.Name() -} - func (g *GenerateCommand) Run() error { historyLimit := time.Now().AddDate(-1*g.employmentHistory, 0, 0) diff --git a/version.go b/version.go index 45367bb..c3a4cfc 100644 --- a/version.go +++ b/version.go @@ -6,7 +6,7 @@ import ( ) type VersionCommand struct { - fs *flag.FlagSet + *flag.FlagSet fullVersion bool } @@ -19,22 +19,14 @@ var ( func NewVersionCommand() *VersionCommand { vc := VersionCommand{ - fs: flag.NewFlagSet("version", flag.ExitOnError), + FlagSet: flag.NewFlagSet("version", flag.ExitOnError), } - vc.fs.BoolVar(&vc.fullVersion, "full", false, "prints the full version") + vc.BoolVar(&vc.fullVersion, "full", false, "prints the full version") return &vc } -func (v *VersionCommand) Parse(args []string) error { - return v.fs.Parse(args) -} - -func (v *VersionCommand) Name() string { - return v.fs.Name() -} - func (v *VersionCommand) Run() error { var version string if v.fullVersion {