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
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

douardda created this revision.May 17 2019, 11:53 AM
douardda updated this revision to Diff 4867.May 17 2019, 11:55 AM

pushed one spurious revision, sorry

douardda added a comment.EditedMay 17 2019, 11:57 AM

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.
ardumont accepted this revision.May 17 2019, 12:01 PM
This revision is now accepted and ready to land.May 17 2019, 12:01 PM
douardda updated this revision to Diff 4868.May 17 2019, 12:04 PM

Better help message using metavars

douardda edited the summary of this revision. (Show Details)May 17 2019, 12:07 PM
douardda updated this revision to Diff 4869.May 17 2019, 12:18 PM

more help msg tweaking

reword the --host option help msg

This revision was automatically updated to reflect the committed changes.