Skip to content

Commit 957ffce

Browse files
committed
chore: improve error messages for project selection in runProjectUseCmd
1 parent c97b673 commit 957ffce

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

pkg/cmd/project_use.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,12 @@ func (lc *projectUseCmd) runProjectUseCmd(cmd *cobra.Command, args []string) err
169169
if !projectFound {
170170
return fmt.Errorf("project '%s' in organization '%s' not found", argProjNameInput, argOrgNameInput)
171171
}
172-
default: // Should not happen due to Args validation by Cobra
173-
return fmt.Errorf("unexpected number of arguments: %d. Expected 0, 1, or 2", len(args))
174172
}
175173

176174
if !projectFound {
177175
// This case should ideally be unreachable if all paths correctly set projectFound or error out.
178176
// It acts as a safeguard.
179-
return fmt.Errorf("an active project could not be determined based on the provided arguments")
177+
return fmt.Errorf("a project could not be determined based on the provided arguments")
180178
}
181179

182180
err = Config.UseProject(selectedProject.Id, selectedProject.Mode)

0 commit comments

Comments
 (0)