MCPcopy Create free account
hub / github.com/docker/secrets-engine / validateArgs

Function validateArgs

plugins/pass/commands/rm.go:63–76  ·  view source on GitHub ↗
(args []string, opts rmOpts)

Source from the content-addressed store, hash-verified

61}
62
63func validateArgs(args []string, opts rmOpts) ([]store.ID, error) {
64 if (len(args) == 0 && !opts.All) || (len(args) > 0 && opts.All) {
65 return nil, fmt.Errorf("either provide a secret name or use --all to remove all secrets")
66 }
67 var result []store.ID
68 for _, arg := range args {
69 id, err := store.ParseID(arg)
70 if err != nil {
71 return nil, err
72 }
73 result = append(result, id)
74 }
75 return result, nil
76}
77
78func runRm(ctx context.Context, out io.Writer, kc store.Store, idList []store.ID, opts rmOpts) error {
79 if opts.All && len(idList) == 0 {

Callers 1

RmCommandFunction · 0.85

Calls 1

ErrorfMethod · 0.65

Tested by

no test coverage detected