(proto string)
| 93 | } |
| 94 | |
| 95 | func argsTarget(proto string) func(cmd *cobra.Command, args []string) error { |
| 96 | |
| 97 | return func(cmd *cobra.Command, args []string) (err error) { |
| 98 | |
| 99 | if len(args) != 1 { |
| 100 | return errors.New("command require exactly one positional argument: [target]") |
| 101 | } |
| 102 | |
| 103 | if credential, target, err = adAuthOpts.WithTarget(context.TODO(), proto, args[0]); err != nil { |
| 104 | return fmt.Errorf("failed to parse target: %w", err) |
| 105 | } |
| 106 | |
| 107 | if credential == nil { |
| 108 | return errors.New("no credentials supplied") |
| 109 | } |
| 110 | if target == nil { |
| 111 | return errors.New("no target supplied") |
| 112 | } |
| 113 | return |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | func argsSmbClient() func(cmd *cobra.Command, args []string) error { |
| 118 | return args( |
no outgoing calls
no test coverage detected
searching dependent graphs…