(deps commandDeps)
| 251 | } |
| 252 | |
| 253 | func newSessionStatusCommand(deps commandDeps) *cobra.Command { |
| 254 | return &cobra.Command{ |
| 255 | Use: "status <id>", |
| 256 | Short: "Show session status", |
| 257 | Example: ` # Show current state for one session |
| 258 | agh session status sess_1234 |
| 259 | |
| 260 | # Read status as JSON for scripts |
| 261 | agh session status sess_1234 -o json`, |
| 262 | Args: exactOneNonBlankArg(), |
| 263 | RunE: func(cmd *cobra.Command, args []string) error { |
| 264 | client, err := clientFromDeps(deps) |
| 265 | if err != nil { |
| 266 | return err |
| 267 | } |
| 268 | |
| 269 | info, err := client.GetSessionStatus(cmd.Context(), args[0]) |
| 270 | if err != nil { |
| 271 | return err |
| 272 | } |
| 273 | return writeCommandOutput(cmd, sessionStatusBundle(info)) |
| 274 | }, |
| 275 | } |
| 276 | } |
| 277 | |
| 278 | func newSessionResumeCommand(deps commandDeps) *cobra.Command { |
| 279 | var ( |
no test coverage detected