(ctx *cli.Context)
| 220 | } |
| 221 | |
| 222 | func parseArgumentToComplete(ctx *cli.Context) string { |
| 223 | var arg string |
| 224 | args := ctx.Args() |
| 225 | l := args.Len() |
| 226 | |
| 227 | if l > 0 { |
| 228 | arg = args.Get(l - 1) |
| 229 | } |
| 230 | |
| 231 | // argument may start with a quotation mark, in this case we want to trim |
| 232 | // that before checking if it has prefix 's3://'. |
| 233 | // Beware that we only want to trim the first char, not all of the leading |
| 234 | // quotation marks, because those quotation marks may be actual characters. |
| 235 | if strings.HasPrefix(arg, "'") { |
| 236 | arg = strings.TrimPrefix(arg, "'") |
| 237 | } else { |
| 238 | arg = strings.TrimPrefix(arg, "\"") |
| 239 | } |
| 240 | return arg |
| 241 | } |
no test coverage detected