Commit d6fd5a40 authored by Vincent Pelletier's avatar Vincent Pelletier

cli,http: Add --version support.

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