| 130 | } |
| 131 | |
| 132 | func argsRpcClient(proto string, endpoint string) func(cmd *cobra.Command, args []string) error { |
| 133 | return args( |
| 134 | argsTarget(proto), |
| 135 | |
| 136 | func(cmd *cobra.Command, args []string) (err error) { |
| 137 | switch { |
| 138 | case rpcClient.Endpoint != "": |
| 139 | case rpcClient.Filter != "": |
| 140 | case endpoint == "": |
| 141 | rpcClient.UseEpm = true |
| 142 | default: |
| 143 | rpcClient.Endpoint = endpoint |
| 144 | } |
| 145 | rpcClient.Target = target |
| 146 | rpcClient.Credential = credential |
| 147 | rpcClient.Proxy = proxy |
| 148 | |
| 149 | return rpcClient.Parse(context.TODO()) |
| 150 | }, |
| 151 | ) |
| 152 | } |
| 153 | |
| 154 | func argsOutput(methods ...string) func(cmd *cobra.Command, args []string) error { |
| 155 | |