We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In Fact a better Argument parsing would be better.
https://docs.python.org/3/library/argparse.html
Il would be great if thoses kind of part use argparse:
def jabber_cmd_jabber(data, buffer, args): """ Command '/jabber'. """ global jabber_servers, jabber_config_option if args == "" or args == "list": jabber_list_servers_chats("") else: argv = args.split(" ") argv1eol = "" pos = args.find(" ") if pos > 0: argv1eol = args[pos+1:] if argv[0] == "list": jabber_list_servers_chats(argv[1]) elif argv[0] == "add": if len(argv) >= 4: server = jabber_search_server_by_name(argv[1]) if server: weechat.prnt("", "jabber: server '%s' already exists" % argv[1]) else: kwargs = {'jid': argv[2], 'password': argv[3]} if len(argv) > 4: conn_server, _, conn_port = argv[4].partition(':') if conn_port and not conn_port.isdigit(): weechat.prnt("", "jabber: error, invalid port, digits only") return weechat.WEECHAT_RC_OK if conn_server: kwargs['server'] = conn_server if conn_port: kwargs['port'] = conn_port server = Server(argv[1], **kwargs) jabber_servers.append(server) weechat.prnt("", "jabber: server '%s' created" % argv[1]) else: weechat.prnt("", "jabber: unable to add server, missing arguments") weechat.prnt("", "jabber: usage: /jabber add name jid password [server[:port]]") elif argv[0] == "alias": alias_command = AliasCommand(buffer, argv=argv[1:]) alias_command.run() elif argv[0] == "connect": # [...]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In Fact a better Argument parsing would be better.
https://docs.python.org/3/library/argparse.html
Il would be great if thoses kind of part use argparse:
The text was updated successfully, but these errors were encountered: