X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;f=sima%2Futils%2Fstartopt.py;h=ef2032c13b0f013c1fecc3a5b0fd4ee21c3e7bc3;hb=78a694ddcd2a6ecc8b2b1fd3c74ee2d938707305;hp=da8bbda6e1763accdff197c652acc944aad85692;hpb=3232d76fccc3b431bd42a34a5f182667efa346d0;p=mpd-sima.git diff --git a/sima/utils/startopt.py b/sima/utils/startopt.py index da8bbda..ef2032c 100644 --- a/sima/utils/startopt.py +++ b/sima/utils/startopt.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2009, 2010, 2011, 2012, 2013 Jack Kaliko +# Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014 Jack Kaliko # # This file is part of sima # @@ -19,11 +19,10 @@ # # -import sys from argparse import (ArgumentParser, SUPPRESS) -from .utils import Obsolete, Wfile, Rfile, Wdir +from .utils import Wfile, Rfile, Wdir USAGE = """USAGE: %prog [--help] [options]""" DESCRIPTION = """ @@ -60,7 +59,7 @@ OPTS = [ 'type': str, 'dest': 'verbosity', 'choices': ['debug', 'info', 'warning', 'error'], - 'help': 'file to log message to, default is stdout/stderr'}, + 'help': 'Log messages verbosity, default is info'}, { 'sw': ['-p', '--pid'], 'dest': 'pidfile', @@ -115,6 +114,7 @@ class StartOpt(object): """ def __init__(self, script_info,): + self.parser = None self.info = dict(script_info) self.options = dict() self.main() @@ -125,7 +125,7 @@ class StartOpt(object): """ self.parser = ArgumentParser(description=DESCRIPTION, usage='%(prog)s [options]', - prog='mpd_sima', + prog=self.info.get('prog'), epilog='Happy Listening', ) self.parser.add_argument('--version', action='version',