MCPcopy Index your code
hub / github.com/rclone/rclone / parseTag

Method parseTag

lib/transform/options.go:96–110  ·  view source on GitHub ↗

parse the tag (file/dir/all), set the option accordingly, and return the trimmed string we don't worry about errors here because it will error anyway as an invalid key

(s string)

Source from the content-addressed store, hash-verified

94//
95// we don't worry about errors here because it will error anyway as an invalid key
96func (t *transform) parseTag(s string) string {
97 if strings.HasPrefix(s, "file,") {
98 t.tag = file
99 return strings.TrimPrefix(s, "file,")
100 }
101 if strings.HasPrefix(s, "dir,") {
102 t.tag = dir
103 return strings.TrimPrefix(s, "dir,")
104 }
105 if strings.HasPrefix(s, "all,") {
106 t.tag = all
107 return strings.TrimPrefix(s, "all,")
108 }
109 return s
110}
111
112// parse key and value (if any) by splitting on '=' sign
113// (file/dir/all tag has already been trimmed)

Callers 1

parseFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected