Commit d6fd5a40 by Vincent Pelletier

cli,http: Add --version support.

1 parent 1cac65d1
......@@ -33,6 +33,7 @@ from cryptography import x509
from cryptography.hazmat.backends import default_backend
from . import exceptions
from . import utils
from . import version
from .client import (
CaucaseError,
CaucaseClient,
......@@ -337,7 +338,10 @@ def main(argv=None):
"""
Command line caucase client entry point.
"""
parser = argparse.ArgumentParser(description='caucase')
parser = argparse.ArgumentParser(
description='caucase',
version=version.__version__,
)
# XXX: currently, it is the server which chooses which digest is used to sign
# stuff.
# Should clients be able to tell it how to sign (and server could reject) ?
......@@ -624,6 +628,7 @@ def probe(argv=None):
"""
parser = argparse.ArgumentParser(
description='caucase probe - Verify basic caucase server functionality',
version=version.__version__,
)
parser.add_argument(
'ca_url',
......@@ -653,6 +658,7 @@ def updater(argv=None, until=utils.until):
parser = argparse.ArgumentParser(
description='caucase updater - '
'Bootstrap certificate and companion files and keep them up-to-date',
version=version.__version__,
)
parser.add_argument(
'--ca-url',
......@@ -870,6 +876,7 @@ def rerequest(argv=None):
description='caucase rerequest - '
'Produce a new private key and sign a CSR created by copying an existing, '
'well-signed CSR.',
version=version.__version__,
)
parser.add_argument(
'--template',
......@@ -928,6 +935,7 @@ def key_id(argv=None):
description='caucase key id - '
'Displays key identifier from private key, and the list of acceptable key'
'identifiers for a given backup file.',
version=version.__version__,
)
parser.add_argument(
'--private-key',
......
......@@ -343,7 +343,10 @@ def main(argv=None, until=utils.until):
"""
Caucase stand-alone http server.
"""
parser = argparse.ArgumentParser(description='caucased')
parser = argparse.ArgumentParser(
description='caucased',
version=version.__version__,
)
parser.add_argument(
'--db',
default='caucase.sqlite',
......@@ -791,6 +794,7 @@ def manage(argv=None):
"""
parser = argparse.ArgumentParser(
description='caucased caucased database management tool',
version=version.__version__,
)
parser.add_argument(
'--db',
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!