ParseCaURL gets and parses the ca-url from the command context. - Require non-empty value. - Prepend an 'https' scheme if the URL does not have a scheme. - Error if the URL scheme is not implicitly or explicitly 'https'.
(ctx *cli.Context)
| 647 | // - Prepend an 'https' scheme if the URL does not have a scheme. |
| 648 | // - Error if the URL scheme is not implicitly or explicitly 'https'. |
| 649 | func ParseCaURL(ctx *cli.Context) (string, error) { |
| 650 | caURL := ctx.String("ca-url") |
| 651 | if caURL == "" && !ctx.Bool("offline") { |
| 652 | return "", errs.RequiredFlag(ctx, "ca-url") |
| 653 | } |
| 654 | |
| 655 | return parseCaURL(ctx, caURL) |
| 656 | } |
| 657 | |
| 658 | // ParseCaURLIfExists gets and parses the ca-url from the command context, if |
| 659 | // one is present. |
searching dependent graphs…