From cfe14436cb5b7aadd1bb3287128952e4088f616b Mon Sep 17 00:00:00 2001 From: Rustam Gilyazov <16064414+rusq@users.noreply.github.com> Date: Fri, 25 Oct 2024 21:46:05 +1000 Subject: [PATCH] wording --- cmd/slackdump/internal/archive/wizard.go | 2 +- cmd/slackdump/internal/export/wizard.go | 2 +- cmd/slackdump/internal/ui/dumpui/dumpui.go | 26 +++++++++++++--------- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/cmd/slackdump/internal/archive/wizard.go b/cmd/slackdump/internal/archive/wizard.go index 2136d064..041f8048 100644 --- a/cmd/slackdump/internal/archive/wizard.go +++ b/cmd/slackdump/internal/archive/wizard.go @@ -9,7 +9,7 @@ import ( func archiveWizard(ctx context.Context, cmd *base.Command, args []string) error { w := &dumpui.Wizard{ - Title: "Archive Slackdump workspace", + Title: "Archive Slack Workspace", Particulars: "Archive", Cmd: cmd, } diff --git a/cmd/slackdump/internal/export/wizard.go b/cmd/slackdump/internal/export/wizard.go index bcccf4bf..c36e3665 100644 --- a/cmd/slackdump/internal/export/wizard.go +++ b/cmd/slackdump/internal/export/wizard.go @@ -9,7 +9,7 @@ import ( func wizExport(ctx context.Context, cmd *base.Command, args []string) error { w := &dumpui.Wizard{ - Title: "Export Slackdump workspace", + Title: "Export Slack Workspace", Particulars: "Export", Cmd: cmd, } diff --git a/cmd/slackdump/internal/ui/dumpui/dumpui.go b/cmd/slackdump/internal/ui/dumpui/dumpui.go index 2a79a24c..dd7bc4a3 100644 --- a/cmd/slackdump/internal/ui/dumpui/dumpui.go +++ b/cmd/slackdump/internal/ui/dumpui/dumpui.go @@ -17,9 +17,15 @@ type Wizard struct { Cmd *base.Command } +const ( + actRun = "run" + actConfig = "config" + actExit = "exit" +) + func (w *Wizard) Run(ctx context.Context) error { var ( - action string = "run" + action string = actRun ) menu := func() *huh.Form { @@ -28,10 +34,10 @@ func (w *Wizard) Run(ctx context.Context) error { huh.NewSelect[string](). Title(w.Title). Options( - huh.NewOption("Run "+w.Particulars, "run"), - huh.NewOption("Configuration", "config"), + huh.NewOption("Run "+w.Particulars, actRun), + huh.NewOption("Configuration...", actConfig), huh.NewOption(ui.MenuSeparator, ""), - huh.NewOption("Exit to Main Menu", "exit"), + huh.NewOption("<< Exit to Main Menu", actExit), ).Value(&action), ), ).WithTheme(ui.HuhTheme).WithAccessible(cfg.AccessibleMode) @@ -43,16 +49,16 @@ LOOP: return err } switch action { - case "exit": - break LOOP - case "config": - if err := cfgui.Show(ctx); err != nil { + case actRun: + if err := w.Cmd.Run(ctx, w.Cmd, nil); err != nil { return err } - case "run": - if err := w.Cmd.Run(ctx, w.Cmd, nil); err != nil { + case actConfig: + if err := cfgui.Show(ctx); err != nil { return err } + case actExit: + break LOOP } }