issue-9: fixed unit tests

This commit is contained in:
Leon Mika 2022-08-29 20:45:34 +10:00
parent 24304d21c3
commit aa7ec9f863
2 changed files with 3 additions and 3 deletions

View file

@ -50,7 +50,7 @@ func main() {
cmdController := commandctrl.NewCommandController()
cmdController.AddCommands(&commandctrl.CommandList{
Commands: map[string]commandctrl.Command{
"cd": func(args []string) tea.Msg {
"cd": func(ec commandctrl.ExecContext, args []string) tea.Msg {
return ctrl.ChangePrefix(args[0])
},
},

View file

@ -32,13 +32,13 @@ func NewModel(controller *controllers.SSMController, cmdController *commandctrl.
cmdController.AddCommands(&commandctrl.CommandList{
Commands: map[string]commandctrl.Command{
"clone": func(args []string) tea.Msg {
"clone": func(ec commandctrl.ExecContext, args []string) tea.Msg {
if currentParam := ssmList.CurrentParameter(); currentParam != nil {
return controller.Clone(*currentParam)
}
return events.Error(errors.New("no parameter selected"))
},
"delete": func(args []string) tea.Msg {
"delete": func(ec commandctrl.ExecContext, args []string) tea.Msg {
if currentParam := ssmList.CurrentParameter(); currentParam != nil {
return controller.DeleteParameter(*currentParam)
}