From e27bf0fcbe3258a5cc71bae4987f464640a14e30 Mon Sep 17 00:00:00 2001 From: brent s Date: Thu, 2 Apr 2020 21:22:57 -0400 Subject: [PATCH] fleshing out the args and adding stub manpage --- docs/vaultpass.1.adoc | 24 ++++++++++++++++++++++++ vaultpass/__init__.py | 3 +++ vaultpass/args.py | 21 +++++++++++++++++++++ vaultpass/constants.py | 1 + vaultpass/pass_import.py | 1 + 5 files changed, 50 insertions(+) create mode 100644 docs/vaultpass.1.adoc create mode 100644 vaultpass/args.py create mode 100644 vaultpass/constants.py create mode 100644 vaultpass/pass_import.py diff --git a/docs/vaultpass.1.adoc b/docs/vaultpass.1.adoc new file mode 100644 index 0000000..9e5dbbc --- /dev/null +++ b/docs/vaultpass.1.adoc @@ -0,0 +1,24 @@ += vaultpass(1) +Brent Saner + +:doctype: manpage +:manmanual: VAULTPASS +:mansource: VAULTPASS +:man-linkstyle: pass:[blue R < >] + +== Name + +vaultpass - A Vault-backed replacement for Pass + +== Synopsis + +*vaultpass* [_OPERATION_] _OPTIONS_... + +[#operations] +== Operations + +See *<>* for arguments that are available for all operations. + +*cp*:: + foo +// TODO diff --git a/vaultpass/__init__.py b/vaultpass/__init__.py index 4b5c050..1038f73 100644 --- a/vaultpass/__init__.py +++ b/vaultpass/__init__.py @@ -3,10 +3,13 @@ import os ## from . import logger _logger = logging.getLogger('VaultPass') +from . import args from . import auth from . import clipboard from . import config +from . import constants from . import mounts +from . import pass_import class PassMan(object): diff --git a/vaultpass/args.py b/vaultpass/args.py new file mode 100644 index 0000000..e169bf7 --- /dev/null +++ b/vaultpass/args.py @@ -0,0 +1,21 @@ +import argparse + + +_opers = ['cp', 'edit', 'find', 'generate', 'git', 'grep', 'help', 'init', 'insert', 'ls', 'mv', 'rm', 'show', + 'version', 'import'] # "import" is new + + +def parseArgs(): + args = argparse.ArgumentParser(description = 'VaultPass - a Vault-backed Pass replacement', + prog = 'pass', + epilog = ('This program has context-specific help. Try ')) + commonargs = argparse.ArgumentParser(add_help = False) + commonargs.add_argument('-c', '--config', + default = '~/.config/vaultpass.xml', + help = ('The path to your configuration file. Default: ~/.config/vaultpass.xml')) + + args.add_argument('oper', + choices = _opers, + help = ('The operation to perform. Use the help operation or see the man page for more ' + 'information')) + args.add_argument() diff --git a/vaultpass/constants.py b/vaultpass/constants.py new file mode 100644 index 0000000..a4e55ec --- /dev/null +++ b/vaultpass/constants.py @@ -0,0 +1 @@ +VERSION = '0.0.1' diff --git a/vaultpass/pass_import.py b/vaultpass/pass_import.py new file mode 100644 index 0000000..21b405d --- /dev/null +++ b/vaultpass/pass_import.py @@ -0,0 +1 @@ +import os