Skip to content

Commit

Permalink
fix: standardize to AddFlags
Browse files Browse the repository at this point in the history
  • Loading branch information
wcrum committed Aug 24, 2024
1 parent b2035d7 commit bbad607
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cmd/hauler/cli/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ hauler login reg.example.com -u bob -p haulin`,
return login(ctx, o, arg[0])
},
}
o.AddArgs(cmd)
o.AddFlags(cmd)

parent.AddCommand(cmd)
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/hauler/cli/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func addStore(parent *cobra.Command) {
return cmd.Help()
},
}
rootStoreOpts.AddArgs(cmd)
rootStoreOpts.AddFlags(cmd)

cmd.AddCommand(
addStoreSync(),
Expand Down Expand Up @@ -58,7 +58,7 @@ func addStoreExtract() *cobra.Command {
return store.ExtractCmd(ctx, o, s, args[0])
},
}
o.AddArgs(cmd)
o.AddFlags(cmd)

return cmd
}
Expand Down Expand Up @@ -190,7 +190,7 @@ func addStoreSave() *cobra.Command {
return store.SaveCmd(ctx, o, o.FileName)
},
}
o.AddArgs(cmd)
o.AddFlags(cmd)

return cmd
}
Expand Down
2 changes: 1 addition & 1 deletion internal/flags/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type ExtractOpts struct {
DestinationDir string
}

func (o *ExtractOpts) AddArgs(cmd *cobra.Command) {
func (o *ExtractOpts) AddFlags(cmd *cobra.Command) {
f := cmd.Flags()

f.StringVarP(&o.DestinationDir, "output", "o", "", "Directory to save contents to (defaults to current directory)")
Expand Down
2 changes: 1 addition & 1 deletion internal/flags/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type LoginOpts struct {
PasswordStdin bool
}

func (o *LoginOpts) AddArgs(cmd *cobra.Command) {
func (o *LoginOpts) AddFlags(cmd *cobra.Command) {
f := cmd.Flags()
f.StringVarP(&o.Username, "username", "u", "", "Username to use for authentication")
f.StringVarP(&o.Password, "password", "p", "", "Password to use for authentication")
Expand Down
2 changes: 1 addition & 1 deletion internal/flags/save.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type SaveOpts struct {
FileName string
}

func (o *SaveOpts) AddArgs(cmd *cobra.Command) {
func (o *SaveOpts) AddFlags(cmd *cobra.Command) {
f := cmd.Flags()

f.StringVarP(&o.FileName, "filename", "f", "haul.tar.zst", "Name of archive")
Expand Down
2 changes: 1 addition & 1 deletion internal/flags/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type StoreRootOpts struct {
CacheDir string
}

func (o *StoreRootOpts) AddArgs(cmd *cobra.Command) {
func (o *StoreRootOpts) AddFlags(cmd *cobra.Command) {
pf := cmd.PersistentFlags()
pf.StringVarP(&o.StoreDir, "store", "s", consts.DefaultStoreName, "Location to create store at")
pf.StringVar(&o.CacheDir, "cache", "", "(deprecated flag and currently not used)")
Expand Down

0 comments on commit bbad607

Please sign in to comment.