You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This doesn't work when using nargs="+" for the argument "command" since that allows an ambiguous number of arguments which must be terminated by either another argument or "--"
For example, take the example from the docs: mcli mc.server.net rcon --command 'msg ILoveCraft Minecraft loves you too!' craft
Given the code in main.py:
rcon_parser.add_argument('-c', '--command', action='append', nargs='+',
help='Command to send to the RCON server. May specify multiple.', required=False)
With action="append" and nargs=+, this is accepting an ambiguous number of values for --command, which gets created as a list of args within another list:
command=[['msg ILoveCraft Minecraft loves you too!', 'craft']]
And the parser ends up with no password.
I've made some updates to make it work like the documentation, removing the nargs of "+", which allows one command per instance of "--command" followed by a final positional argument for the password.
The docs at https://mctools.readthedocs.io/en/master/mcli.html#examples state that multiple commands can be specified, followed by the password as a final positional argument.
This doesn't work when using nargs="+" for the argument "command" since that allows an ambiguous number of arguments which must be terminated by either another argument or "--"
For example, take the example from the docs:
mcli mc.server.net rcon --command 'msg ILoveCraft Minecraft loves you too!' craft
Given the code in main.py:
With action="append" and nargs=+, this is accepting an ambiguous number of values for --command, which gets created as a list of args within another list:
command=[['msg ILoveCraft Minecraft loves you too!', 'craft']]
And the parser ends up with no password.
I've made some updates to make it work like the documentation, removing the nargs of "+", which allows one command per instance of "--command" followed by a final positional argument for the password.
Tell me what you think.
I created a local branch and committed a fix, but I can't create a new branch here in order to make a pull request.
The text was updated successfully, but these errors were encountered: