Skip to content

Commit

Permalink
Add TUI flag to images
Browse files Browse the repository at this point in the history
Signed-off-by: Evan Harris <echarris@smcm.edu>
  • Loading branch information
eharris128 committed Sep 2, 2024
1 parent ccf1d07 commit 05bf527
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/app/master/command/images/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ const (
type CommandParams struct {
Runtime string `json:"runtime,omitempty"`
Filter string `json:"filter,omitempty"`
TUI bool `json:"tui"`
}

var ImagesFlags = []cli.Flag{
command.Cflag(command.FlagRuntime),
cflag(FlagFilter),
cflag(FlagTUI),
}

//todo soon: add a lot of useful filtering flags
Expand All @@ -46,6 +48,7 @@ var CLI = &cli.Command{
cparams := &CommandParams{
Runtime: ctx.String(command.FlagRuntime),
Filter: ctx.String(FlagFilter),
TUI: ctx.Bool(FlagTUI),
}

OnCommand(xc, gcvalues, cparams)
Expand Down
6 changes: 6 additions & 0 deletions pkg/app/master/command/images/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
const (
FlagFilter = "filter"
FlagFilterUsage = "container image filter pattern"
FlagTUI = "tui"
FlagTUIUsage = "terminal user interface"
)

var Flags = map[string]cli.Flag{
Expand All @@ -18,6 +20,10 @@ var Flags = map[string]cli.Flag{
Usage: FlagFilterUsage,
EnvVars: []string{"DSLIM_IMAGES_FILTER"},
},
FlagTUI: &cli.BoolFlag{
Name: FlagTUI,
Usage: FlagTUIUsage,
},
}

func cflag(name string) cli.Flag {
Expand Down

0 comments on commit 05bf527

Please sign in to comment.