Skip to content

Fix #117: Adds "switch" command#152

Merged
ivaaaan merged 2 commits intoivaaaan:masterfrom
rgcr:switch-cmd
Feb 10, 2026
Merged

Fix #117: Adds "switch" command#152
ivaaaan merged 2 commits intoivaaaan:masterfrom
rgcr:switch-cmd

Conversation

@rgcr
Copy link
Copy Markdown
Contributor

@rgcr rgcr commented Feb 10, 2026

Adds switch command as an alias for start <project> -a

  • In options.go file basically identifies if it's switch command then enables the Attach flag and continues the original logic
if cmd.Name == CommandSwitch {
    opts.Attach = true
}
  • If no session name is passed shows an error message
./smug-test switch
switch requires a project name
  • If there is no a config file shows the proper error as smug start
./smug-test switch XYZ
config not found for project XYZ
  • Man pages, completions and test are updated
  • All tests passed with no errors
 go test .
ok      github.com/ivaaaan/smug 0.925s

@rgcr
Copy link
Copy Markdown
Contributor Author

rgcr commented Feb 10, 2026

I forgot to mention that I took the chance to add ls as alias for smug list 😄

{
    Name:    CommandList,
    Aliases: []string{"l", "ls"},
}

@ivaaaan ivaaaan merged commit a834d23 into ivaaaan:master Feb 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants