AddFlags registers the "server" and "secret-keyring" string flags.
()
| 50 | |
| 51 | // AddFlags registers the "server" and "secret-keyring" string flags. |
| 52 | func AddFlags() { |
| 53 | defaultPath := "/x/y/z/we're/in-a-test" |
| 54 | if !buildinfo.TestingLinked() { |
| 55 | defaultPath = osutil.UserClientConfigPath() |
| 56 | } |
| 57 | flag.StringVar(&flagServer, "server", "", "Perkeep server prefix. If blank, the default from the \"server\" field of "+defaultPath+" is used. Acceptable forms: https://you.example.com, example.com:1345 (https assumed), or http://you.example.com/alt-root") |
| 58 | osutil.AddSecretRingFlag() |
| 59 | } |
| 60 | |
| 61 | // ExplicitServer returns the Perkeep server given in the "server" |
| 62 | // flag, if any. |
no test coverage detected