diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ceee861..95f55d7 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -34,10 +34,14 @@ "go.gocodeAutoBuild": true, "go.formatTool": "gofmt", "go.useLanguageServer": true, + "cSpell.words": [ + "tmuxist" + ], }, "extensions": [ "golang.go", "editorconfig.editorconfig", - "esbenp.prettier-vscode" + "esbenp.prettier-vscode", + "streetsidesoftware.code-spell-checker" ], } \ No newline at end of file diff --git a/command/attach.go b/command/attach.go index 1e1c9ae..3aa660c 100644 --- a/command/attach.go +++ b/command/attach.go @@ -56,7 +56,7 @@ func (cmd *AttachCommand) Execute(_ context.Context, f *flag.FlagSet, _ ...inter return subcommands.ExitFailure } - r := renderer.AttachRenderer{c} + r := renderer.AttachRenderer{Config: c} if err := shell_helper.Exec(r.Render()); err != nil { logger.Err(err.Error()) return subcommands.ExitFailure diff --git a/command/kill.go b/command/kill.go index 116e4d9..8001deb 100644 --- a/command/kill.go +++ b/command/kill.go @@ -56,7 +56,7 @@ func (cmd *KillCommand) Execute(_ context.Context, f *flag.FlagSet, _ ...interfa return subcommands.ExitFailure } - r := renderer.KillRenderer{c} + r := renderer.KillRenderer{Config: c} if err := shell_helper.Exec(r.Render()); err != nil { logger.Err(err.Error()) return subcommands.ExitFailure diff --git a/command/list.go b/command/list.go index fb5f7c3..c994856 100644 --- a/command/list.go +++ b/command/list.go @@ -12,30 +12,30 @@ import ( "github.com/google/subcommands" ) -// LIstCommand represents a version command. -type LIstCommand struct{} +// ListCommand represents a version command. +type ListCommand struct{} -// Name returns the name of LIstCommand. -func (*LIstCommand) Name() string { +// Name returns the name of ListCommand. +func (*ListCommand) Name() string { return "list" } -// Synopsis returns a short string describing LIstCommand. -func (*LIstCommand) Synopsis() string { +// Synopsis returns a short string describing ListCommand. +func (*ListCommand) Synopsis() string { return "List tmuxist profiles" } -// Usage returns a long string explaining LIstCommand and givinig usage. -func (*LIstCommand) Usage() string { +// Usage returns a long string explaining ListCommand and givinig usage. +func (*ListCommand) Usage() string { return "list: show tmuxist profiles\n" } -// SetFlags adds the flags for LIstCommand to the specified set. -func (*LIstCommand) SetFlags(f *flag.FlagSet) { +// SetFlags adds the flags for ListCommand to the specified set. +func (*ListCommand) SetFlags(f *flag.FlagSet) { } // Execute executes print version and returns an ExitStatus. -func (*LIstCommand) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus { +func (*ListCommand) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus { path, err := config.ConfigurationDirectoryPath() if err != nil { logger.Err(err.Error()) diff --git a/command/start.go b/command/start.go index b2d5065..26713fd 100644 --- a/command/start.go +++ b/command/start.go @@ -10,7 +10,7 @@ import ( "tmuxist/config" shell_helper "tmuxist/helper/shell" "tmuxist/logger" - "tmuxist/renderer" + renderer "tmuxist/renderer" ) // StartCommand represents a startup tmux session command. @@ -56,7 +56,7 @@ func (cmd *StartCommand) Execute(_ context.Context, f *flag.FlagSet, _ ...interf return subcommands.ExitFailure } - r := renderer.StartRenderer{c} + r := renderer.StartRenderer{Config: c} if err := shell_helper.Exec(r.Render()); err != nil { logger.Err(err.Error()) return subcommands.ExitFailure diff --git a/main.go b/main.go index 94d7619..dfececd 100644 --- a/main.go +++ b/main.go @@ -14,7 +14,7 @@ import ( func main() { logger.Setup(os.Stderr) - subcommands.Register(&command.LIstCommand{}, "") + subcommands.Register(&command.ListCommand{}, "") subcommands.Register(&command.InitCommand{}, "") subcommands.Register(&command.EditCommand{}, "") subcommands.Register(&command.PrintCommand{}, "") diff --git a/renderer/start_test.go b/renderer/start_test.go index b99e369..2f50a70 100644 --- a/renderer/start_test.go +++ b/renderer/start_test.go @@ -109,7 +109,7 @@ cd ~ echo "hoge" ` - p := config.Pane{command} + p := config.Pane{Command: command} actual := r.renderPane(&p, true) expected := `PANE_NO=$WINDOW_NO