2013-12-12 11:24:37 +00:00
|
|
|
# -*- encoding: utf-8 -*-
|
|
|
|
|
|
|
|
import pkg_resources
|
|
|
|
dist = pkg_resources.get_distribution("isso")
|
|
|
|
|
|
|
|
import os
|
2013-12-24 09:18:34 +00:00
|
|
|
from argparse import ArgumentParser, SUPPRESS
|
2013-12-12 11:24:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2013-12-24 09:18:34 +00:00
|
|
|
def get_parser(desc):
|
2013-12-12 11:24:37 +00:00
|
|
|
|
2013-12-24 09:18:34 +00:00
|
|
|
parser = ArgumentParser(description=desc)
|
2013-12-12 11:24:37 +00:00
|
|
|
|
2013-12-24 09:18:34 +00:00
|
|
|
parser.add_argument('--version', action='version', version='%(prog)s' + dist.version,
|
|
|
|
help=SUPPRESS)
|
2013-12-12 11:24:37 +00:00
|
|
|
parser.add_argument('-c', dest="conf", default=os.environ.get("ISSO_SETTINGS"),
|
|
|
|
metavar="/etc/isso.conf", help="set configuration file")
|
|
|
|
|
2013-12-24 09:18:34 +00:00
|
|
|
return parser
|