summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlos Alexandro Becker <caarlos0@users.noreply.github.com>2024-11-15 14:58:56 -0300
committerCarlos Alexandro Becker <caarlos0@users.noreply.github.com>2024-11-15 14:58:56 -0300
commit2bc97ac29278d85af1a31fa949d51a50a5715d94 (patch)
treeaca62b0741c25ea4c8eb8965575e9ea6ce3b3c34
parent93da22d656e810ecd6ceb0dfe0375fdab8748a38 (diff)
feat(filepicker): show permissions and sizefilepicker-size-perms
closes #495
-rw-r--r--file/command.go3
-rw-r--r--file/options.go12
2 files changed, 9 insertions, 6 deletions
diff --git a/file/command.go b/file/command.go
index f60ed29..7d02b6e 100644
--- a/file/command.go
+++ b/file/command.go
@@ -46,6 +46,8 @@ func (o Options) Run() error {
FileAllowed(o.File).
Height(o.Height).
ShowHidden(o.All).
+ ShowSize(o.Size).
+ ShowPermissions(o.Permissions).
Value(&path),
),
).
@@ -53,7 +55,6 @@ func (o Options) Run() error {
WithKeyMap(keymap).
WithTheme(theme).
Run()
-
if err != nil {
return err
}
diff --git a/file/options.go b/file/options.go
index 5d4593d..072bd34 100644
--- a/file/options.go
+++ b/file/options.go
@@ -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_"`