Skip to content

Commit

Permalink
Merge pull request #24 from krysopath/3-cli-functions
Browse files Browse the repository at this point in the history
add some very basic cli code
  • Loading branch information
krysopath authored Jun 21, 2019
2 parents 2c6b2a4 + e72a030 commit 73bac1b
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions vaultify/cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import argparse
import sys

def main():
parser = argparse.ArgumentParser()

parser.add_argument(
"action", default="run"
)

parser.add_argument(
"-v", "--verbosity",
type=str,
default='WARN',
choices=['DEBUG', 'INFO', 'WARN', 'CRIT'],
help="set logging verbosity"
)

parser.add_argument(
'-c', '--config',
type=argparse.FileType('r'),
default=sys.stdin,
help="specify a configuration file to override defaults, if not specified, STDIN will be used"
)

args = parser.parse_args()
print(args)
inp = args.config.read()
if inp:
print(inp)

0 comments on commit 73bac1b

Please sign in to comment.