add --version
This commit is contained in:
parent
41f340a595
commit
d0209dbdea
2 changed files with 25 additions and 13 deletions
30
README.md
30
README.md
|
@ -25,8 +25,9 @@ or with pip:
|
|||
|
||||
```
|
||||
$ pass2csv --help
|
||||
usage: pass2csv [-h] [-b path] [-g executable] [-a] [--encodings encodings]
|
||||
[-e pattern] [-f name pattern] [-l name pattern]
|
||||
usage: pass2csv [-h] [-b path] [-g executable] [-a]
|
||||
[--encodings encodings] [-e pattern] [-f name pattern]
|
||||
[-l name pattern] [--version]
|
||||
STOREPATH OUTFILE
|
||||
|
||||
positional arguments:
|
||||
|
@ -37,22 +38,25 @@ options:
|
|||
-h, --help show this help message and exit
|
||||
-b path, --base path path to use as base for grouping passwords
|
||||
-g executable, --gpg executable
|
||||
path to the gpg binary you wish to use (default 'gpg')
|
||||
path to the gpg binary you wish to use (default:
|
||||
'gpg')
|
||||
-a, --use-agent ask gpg to use its auth agent
|
||||
--encodings encodings
|
||||
comma-separated text encodings to try, in order, when
|
||||
decoding gpg output (default 'utf-8')
|
||||
comma-separated text encodings to try, in order,
|
||||
when decoding gpg output (default: 'utf-8')
|
||||
-e pattern, --exclude pattern
|
||||
regexp for lines which should not be exported, can be
|
||||
specified multiple times
|
||||
regexp for lines which should not be exported, can
|
||||
be specified multiple times
|
||||
-f name pattern, --get-field name pattern
|
||||
a name and a regexp, the part of the line matching the
|
||||
regexp will be removed and the remaining line will be
|
||||
added to a field with the chosen name. only one match
|
||||
per password, matching stops after the first match
|
||||
a name and a regexp, the part of the line matching
|
||||
the regexp will be removed and the remaining line
|
||||
will be added to a field with the chosen name.
|
||||
only one match per password, matching stops after
|
||||
the first match
|
||||
-l name pattern, --get-line name pattern
|
||||
a name and a regexp for which all lines that match are
|
||||
included in a field with the chosen name
|
||||
a name and a regexp for which all lines that match
|
||||
are included in a field with the chosen name
|
||||
--version show program's version number and exit
|
||||
```
|
||||
|
||||
|
||||
|
|
8
pass2csv
8
pass2csv
|
@ -8,6 +8,8 @@ import sys
|
|||
|
||||
import gnupg
|
||||
|
||||
__version__ = '1.0.0'
|
||||
|
||||
logging.basicConfig(level=logging.INFO, format='%(message)s')
|
||||
|
||||
|
||||
|
@ -238,6 +240,12 @@ def parse_args(args=None):
|
|||
dest='get_lines'
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
'--version',
|
||||
action='version',
|
||||
version='%(prog)s ' + __version__
|
||||
)
|
||||
|
||||
return parser.parse_args(args)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue