Page MenuHomeSoftware Heritage

cli: replace the 'vault' cmd with cli group with a 'rpc-serve' subcmd
ClosedPublic

Authored by douardda on May 17 2019, 11:53 AM.

Details

Summary

so that one should use:

swh vault rpc-server

as in other swh packages.

The deprecated swh-vault command should still work as expected.

Also improve config file loading behavior as well as the help for this.

Resulting help msg looks like:

$ swh vault rpc-serve -h
Usage: swh vault rpc-serve [OPTIONS]

  Software Heritage Vault RPC server.

  If the CONFIGFILE option is not set, the default config file
  search will be used; first the SWH_CONFIG_FILENAME environment
  variable will be checked, then the config file will be searched
  in:

  - ~/.config/swh/vault/server(.yml|.ini)

  - ~/.swh/vault/server(.yml|.ini)

  - /etc/softwareheritage/vault/server(.yml|.ini)

Options:
  -C, --config-file CONFIGFILE  Configuration file.
  --no-stdout                   Do NOT output logs on the console
  --host HOST                   Host to run the server
  --port PORT                   Binding port of the server
  --debug / --no-debug          Indicates if the server should run in
                                debug mode
  -h, --help                    Show this message and exit.

Diff Detail

Repository
rDVAU Software Heritage Vault
Branch
wip
Lint
Lint Skipped
Unit
Unit Tests Skipped
Build Status
Buildable 5779
Build 7915: tox-on-jenkinsJenkins
Build 7914: arc lint + arc unit

Event Timeline

pushed one spurious revision, sorry

The help msg stuff in cli provides:

$ swh vault rpc-serve -h
Usage: swh vault rpc-serve [OPTIONS]

  Software Heritage Vault RPC server.

  If the CONFIGFILE option is not set, the default config file
  search will be used; first the SWH_CONFIG_FILENAME environment
  variable will be checked, then the config file will be searched
  in:

  - ~/.config/swh/vault/server(.yml|.ini)

  - ~/.swh/vault/server(.yml|.ini)

  - /etc/softwareheritage/vault/server(.yml|.ini)

Options:
  -C, --config-file CONFIGFILE  Configuration file.
  --no-stdout                   Do NOT output logs on the console
  --host HOST                   Host to run the server
  --port PORT                   Binding port of the server
  --debug / --no-debug          Indicates if the server should run in
                                debug mode
  -h, --help                    Show this message and exit.
This revision is now accepted and ready to land.May 17 2019, 12:01 PM

Better help message using metavars

more help msg tweaking

reword the --host option help msg

This revision was automatically updated to reflect the committed changes.