(cmd *cobra.Command, args []string)
| 48 | } |
| 49 | |
| 50 | func inspectAction(cmd *cobra.Command, args []string) error { |
| 51 | globalOptions, err := helpers.ProcessRootCmdFlags(cmd) |
| 52 | if err != nil { |
| 53 | return err |
| 54 | } |
| 55 | mode, err := cmd.Flags().GetString("mode") |
| 56 | if err != nil { |
| 57 | return err |
| 58 | } |
| 59 | format, err := cmd.Flags().GetString("format") |
| 60 | if err != nil { |
| 61 | return err |
| 62 | } |
| 63 | |
| 64 | options := types.NetworkInspectOptions{ |
| 65 | GOptions: globalOptions, |
| 66 | Mode: mode, |
| 67 | Format: format, |
| 68 | Networks: args, |
| 69 | Stdout: cmd.OutOrStdout(), |
| 70 | } |
| 71 | |
| 72 | client, ctx, cancel, err := clientutil.NewClient(cmd.Context(), options.GOptions.Namespace, options.GOptions.Address) |
| 73 | if err != nil { |
| 74 | return err |
| 75 | } |
| 76 | defer cancel() |
| 77 | |
| 78 | return network.Inspect(ctx, client, options) |
| 79 | } |
| 80 | |
| 81 | func networkInspectShellComplete(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { |
| 82 | // show network names, including "bridge" |
nothing calls this directly
no test coverage detected
searching dependent graphs…