Skip to content

Commit

Permalink
Merge pull request #3 from schinckel/dash-dash-version
Browse files Browse the repository at this point in the history
Support graaf --version
  • Loading branch information
funkybob committed Mar 7, 2017
2 parents 96e7605 + bb7ebcd commit 970323d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions graaf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

from .base import get_yaml

VERSION = (0, 2, 0)


def get_version():
return '.'.join(map(str, VERSION))


class Processor(object):
'''
Expand Down
8 changes: 8 additions & 0 deletions scripts/graaf
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import argparse
from importlib import import_module
import sys

from graaf import Processor
from graaf.base import get_yaml
Expand All @@ -17,9 +18,16 @@ parser.add_argument('--templates', '-t', metavar='TMPL', default=None,
help='Directory to search for templates in.')
parser.add_argument('--config', '-c', metavar='CONFIG', default='graaf.yml',
help='Specify config file to use.')
parser.add_argument('--version', '-V', action='store_true',
help='Print the version number and exit.')

args = parser.parse_args()

if args.version:
from graaf import get_version
print(get_version())
sys.exit()

config = get_yaml(args.config)

opts = {}
Expand Down

0 comments on commit 970323d

Please sign in to comment.