Skip to content

Commit

Permalink
fix broken cli flags (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgadban authored Jan 5, 2022
1 parent cd7c6ae commit 2c71f6f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/cli/internal/commands/initialize/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ type InitOptions struct {
}

func addToFlags(flags *pflag.FlagSet, opts *InitOptions) {
flags.StringVarP(&opts.Language, "languague", "l", "", "Language to use for the bpf program")
flags.StringVarP(&opts.Language, "language", "l", "", "Language to use for the bpf program")
flags.StringVarP(&opts.MapType, "map", "m", "", "Map type to initialize")
flags.StringVarP(&opts.FilePath, "file", "f", "", "File to create skeleton in")
flags.StringVarP(&opts.OutputType, "output-type", "o", "", "The output type for your map")
flags.StringVar(&opts.OutputType, "program-type", "", "The type of program to create (e.g. network, file-system)")

flags.StringVar(&opts.ProgramType, "program-type", "", "The type of program to create (e.g. network, file-system)")
}

func Command() *cobra.Command {
opts := &InitOptions{}

Expand All @@ -53,13 +53,14 @@ func initialize(opts *InitOptions) error {
}

programType := opts.ProgramType
var mapTemplate *templateData
if programType == "" {
programType, err = selectProgramType()
if err != nil {
return err
}
}

var mapTemplate *templateData
if programType == network {
mapTemplate, err = handleNetworkProgram(opts)
if err != nil {
Expand Down

0 comments on commit 2c71f6f

Please sign in to comment.