(cli *cli)
| 244 | } |
| 245 | |
| 246 | func openLogStreamsCmd(cli *cli) *cobra.Command { |
| 247 | var inputs struct { |
| 248 | ID string |
| 249 | } |
| 250 | |
| 251 | cmd := &cobra.Command{ |
| 252 | Use: "open", |
| 253 | Args: cobra.MaximumNArgs(1), |
| 254 | Short: "Open the settings page of a log stream", |
| 255 | Long: "Open a log stream's settings page in the Auth0 Dashboard.", |
| 256 | Example: ` auth0 logs streams open |
| 257 | auth0 logs streams open <log-stream-id>`, |
| 258 | RunE: func(cmd *cobra.Command, args []string) error { |
| 259 | if len(args) == 0 { |
| 260 | if err := logStreamID.Pick(cmd, &inputs.ID, cli.allLogStreamsPickerOptions); err != nil { |
| 261 | return err |
| 262 | } |
| 263 | } else { |
| 264 | inputs.ID = args[0] |
| 265 | } |
| 266 | |
| 267 | openManageURL(cli, cli.Config.DefaultTenant, formatLogStreamSettingsPath(inputs.ID)) |
| 268 | |
| 269 | return nil |
| 270 | }, |
| 271 | } |
| 272 | |
| 273 | return cmd |
| 274 | } |
| 275 | |
| 276 | func formatLogStreamSettingsPath(id string) string { |
| 277 | if len(id) == 0 { |
no test coverage detected