Download:
child 5:754ae6ae2c54
parent 3:12c6cbab21e4
4:4b0145336c46
Anton Shestakov <av6@dwimlabs.net>, Tue, 10 May 2016 14:33:06 +0800
rollbot: ArgumentParser can infer dest using long option strings

1 файлов изменено, 3 вставок(+), 3 удалений(-) [+]
rollbot.py file | annotate | diff | comparison | revisions
--- a/rollbot.py Mon May 09 21:51:10 2016 +0800
+++ b/rollbot.py Tue May 10 14:33:06 2016 +0800
@@ -41,9 +41,9 @@
def main():
parser = ArgumentParser()
- parser.add_argument('-j', '--jid', dest='jid', help='JID to use')
- parser.add_argument('-p', '--password', dest='password', help='password to use')
- parser.add_argument('-n', '--nick', dest='nick', help='MUC nickname', default='rollbot')
+ parser.add_argument('-j', '--jid', help='JID to use')
+ parser.add_argument('-p', '--password', help='password to use')
+ parser.add_argument('-n', '--nick', help='MUC nickname', default='rollbot')
group = parser.add_mutually_exclusive_group()
group.add_argument('-q', '--quiet', help='set logging to ERROR', action='store_const', dest='loglevel', const=logging.ERROR, default=logging.INFO)