@@ -157,7 +157,7 @@ func (r *RootCmd) ssh() *serpent.Command {
157157 }
158158 }
159159
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 ])
161161 if err != nil {
162162 return err
163163 }
@@ -551,10 +551,12 @@ startWatchLoop:
551551// getWorkspaceAgent returns the workspace and agent selected using either the
552552// `<workspace>[.<agent>]` syntax via `in`.
553553// 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
555555 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 , "." )
558560 err error
559561 )
560562
0 commit comments