(deps commandDeps, workspaceRef *string, use string)
| 810 | } |
| 811 | |
| 812 | func newNetworkWorkLookupCommand(deps commandDeps, workspaceRef *string, use string) *cobra.Command { |
| 813 | var workID string |
| 814 | cmd := &cobra.Command{ |
| 815 | Use: use, |
| 816 | Short: "Show one network work item", |
| 817 | RunE: func(cmd *cobra.Command, _ []string) error { |
| 818 | client, err := clientFromDeps(deps) |
| 819 | if err != nil { |
| 820 | return err |
| 821 | } |
| 822 | workspace, err := resolveNetworkWorkspaceRef(cmd, deps, client, workspaceRef) |
| 823 | if err != nil { |
| 824 | return err |
| 825 | } |
| 826 | work, err := client.NetworkWork(cmd.Context(), workspace, strings.TrimSpace(workID)) |
| 827 | if err != nil { |
| 828 | return err |
| 829 | } |
| 830 | return writeCommandOutput(cmd, networkWorkBundle(work)) |
| 831 | }, |
| 832 | } |
| 833 | cmd.Flags().StringVar(&workID, "work", "", "Network work id") |
| 834 | mustMarkFlagRequired(cmd, "work") |
| 835 | return cmd |
| 836 | } |
| 837 | |
| 838 | type networkSendFlags struct { |
| 839 | sessionID string |
no test coverage detected