Skip to content

Commit

Permalink
feat(filepicker): show permissions and size (#717)
Browse files Browse the repository at this point in the history
closes #495
  • Loading branch information
caarlos0 authored Nov 18, 2024
1 parent 6ad8882 commit 60a4b3b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion file/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,15 @@ func (o Options) Run() error {
FileAllowed(o.File).
Height(o.Height).
ShowHidden(o.All).
ShowSize(o.Size).
ShowPermissions(o.Permissions).
Value(&path),
),
).
WithShowHelp(o.ShowHelp).
WithKeyMap(keymap).
WithTheme(theme).
Run()

if err != nil {
return err
}
Expand Down
12 changes: 7 additions & 5 deletions file/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ type Options struct {
// Path is the path to the folder / directory to begin traversing.
Path string `arg:"" optional:"" name:"path" help:"The path to the folder to begin traversing" env:"GUM_FILE_PATH"`
// Cursor is the character to display in front of the current selected items.
Cursor string `short:"c" help:"The cursor character" default:">" env:"GUM_FILE_CURSOR"`
All bool `short:"a" help:"Show hidden and 'dot' files" default:"false" env:"GUM_FILE_ALL"`
File bool `help:"Allow files selection" default:"true" env:"GUM_FILE_FILE"`
Directory bool `help:"Allow directories selection" default:"false" env:"GUM_FILE_DIRECTORY"`
ShowHelp bool `help:"Show help key binds" negatable:"" default:"true" env:"GUM_FILE_SHOW_HELP"`
Cursor string `short:"c" help:"The cursor character" default:">" env:"GUM_FILE_CURSOR"`
All bool `short:"a" help:"Show hidden and 'dot' files" default:"false" env:"GUM_FILE_ALL"`
Permissions bool `short:"p" help:"Show file permissions" default:"true" negatable:"" env:"GUM_FILE_PERMISSION"`
Size bool `short:"s" help:"Show file size" default:"true" negatable:"" env:"GUM_FILE_SIZE"`
File bool `help:"Allow files selection" default:"true" env:"GUM_FILE_FILE"`
Directory bool `help:"Allow directories selection" default:"false" env:"GUM_FILE_DIRECTORY"`
ShowHelp bool `help:"Show help key binds" negatable:"" default:"true" env:"GUM_FILE_SHOW_HELP"`

Height int `help:"Maximum number of files to display" default:"0" env:"GUM_FILE_HEIGHT"`
CursorStyle style.Styles `embed:"" prefix:"cursor." help:"The cursor style" set:"defaultForeground=212" envprefix:"GUM_FILE_CURSOR_"`
Expand Down

0 comments on commit 60a4b3b

Please sign in to comment.