Skip to content
Snippets Groups Projects
  • W. Trevor King's avatar
    35e07773
    irkerd: Fix -i / --immediate handling, and add a message argument · 35e07773
    W. Trevor King authored
    This fixes some problems with -i/--immediate parsing in ccd311c5
    (irkerd: Transition from getopt to argparse, 2014-03-06).
    
    > +    parser.add_argument(
    > +        '-i', '--immediate', action='store_const', const=True,
    > +        help='disconnect after sending each message')
    
    This does not match the old syntax where -i took two arguments (an IRC
    URL and a message).
    
    > -    if immediate:
    > +    if args.immediate:
    >          irker.irc.add_event_handler("quit", lambda _c, _e: sys.exit(0))
    >          irker.handle('{"to":"%s","privmsg":"%s"}' % (immediate, arguments[0]), quit_after=True)
    >          irker.irc.spin()
    
    immediate should be args.immediate, and arguments[0] needs to be added
    as a new (optional) positional argument.
    
    This patch fixes both issues.
    35e07773
    History
    irkerd: Fix -i / --immediate handling, and add a message argument
    W. Trevor King authored
    This fixes some problems with -i/--immediate parsing in ccd311c5
    (irkerd: Transition from getopt to argparse, 2014-03-06).
    
    > +    parser.add_argument(
    > +        '-i', '--immediate', action='store_const', const=True,
    > +        help='disconnect after sending each message')
    
    This does not match the old syntax where -i took two arguments (an IRC
    URL and a message).
    
    > -    if immediate:
    > +    if args.immediate:
    >          irker.irc.add_event_handler("quit", lambda _c, _e: sys.exit(0))
    >          irker.handle('{"to":"%s","privmsg":"%s"}' % (immediate, arguments[0]), quit_after=True)
    >          irker.irc.spin()
    
    immediate should be args.immediate, and arguments[0] needs to be added
    as a new (optional) positional argument.
    
    This patch fixes both issues.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.