@@ -157,7 +157,7 @@ func (r *RootCmd) ssh() *serpent.Command {
157
157
}
158
158
}
159
159
160
- workspace , workspaceAgent , err := getWorkspaceAndAgent (ctx , inv , client , ! disableAutostart , codersdk . Me , inv .Args [0 ])
160
+ workspace , workspaceAgent , err := getWorkspaceAndAgent (ctx , inv , client , ! disableAutostart , inv .Args [0 ])
161
161
if err != nil {
162
162
return err
163
163
}
@@ -551,10 +551,12 @@ startWatchLoop:
551
551
// getWorkspaceAgent returns the workspace and agent selected using either the
552
552
// `<workspace>[.<agent>]` syntax via `in`.
553
553
// If autoStart is true, the workspace will be started if it is not already running.
554
- func getWorkspaceAndAgent (ctx context.Context , inv * serpent.Invocation , client * codersdk.Client , autostart bool , userID string , in string ) (codersdk.Workspace , codersdk.WorkspaceAgent , error ) { //nolint:revive
554
+ func getWorkspaceAndAgent (ctx context.Context , inv * serpent.Invocation , client * codersdk.Client , autostart bool , input string ) (codersdk.Workspace , codersdk.WorkspaceAgent , error ) { //nolint:revive
555
555
var (
556
- workspace codersdk.Workspace
557
- workspaceParts = strings .Split (in , "." )
556
+ workspace codersdk.Workspace
557
+ // The input will be `owner/name.agent`
558
+ // The agent is optional.
559
+ workspaceParts = strings .Split (input , "." )
558
560
err error
559
561
)
560
562
0 commit comments