-
-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
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
BUG/FEATURE REQUEST: "Param" does not support spaces #758
Comments
What if you invoke it as "--extra_label=LabelB"?
Shell convention says that long-name arguments should have their values set
with =, and short-name arguments assign from the value following the
argument.
…On Fri, Aug 9, 2024, 1:57 PM Lionel Zhang ***@***.***> wrote:
Script config in UI:
image.png (view on web)
<https://github.com/user-attachments/assets/7d4f9fd7-3f36-4e2b-a352-ddf9ce16b15c>
The test script:
from argparse import ArgumentParser
def parse_args():
parser = ArgumentParser()
parser.add_argument("--extra_label", nargs=2, action="append", metavar=("LABEL_NAME", "LABEL_VALUE"))
return parser.parse_args()
args = parse_args()
print(args.extra_label)
Output error:
image.png (view on web)
<https://github.com/user-attachments/assets/ec9748f3-e452-4496-b037-32c260c10bd0>
When I copy paste the command that was supposed run in the "HISTORY" menu,
it runs successfully:
image.png (view on web)
<https://github.com/user-attachments/assets/f6018e28-5f99-43df-8a47-8b87322c7f1b>
------------------------------
The suspected reason for error, is that there can't be spaces in the
command ("result"). E.g. when I added the two lines that are commented
below, it would work.
image.png (view on web)
<https://github.com/user-attachments/assets/4277cd75-288d-4cbf-8bc6-32363836a832>
—
Reply to this email directly, view it on GitHub
<#758>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A3HBI3VLSRL6GBKIYGBPKNLZQT7JRAVCNFSM6AAAAABMI4RILSVHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ2TQNBQGY3TEMI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Hi @0lionelzhang0, it's supposed to work this way. Everything is sent to scripts as isolated arguments, i.e. effectively the same as being wrapped in quotes, e.g. @MNeill73 from what I know, argparse won't work with this syntax. Thanks for the suggestion though! |
Thank you for getting back to me so quickly! I understand that this behavior is expected based on the implementation. It was just a little unintuitive and frustrating when trying to debug, since the command shown in the "HISTORY" and log files doesn't reflect the "invisible" single-quotes that the backend executes the command with. |
Script config in UI:
![image](./?url=aHR0cHM6Ly9wcml2YXRlLXVzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8zNjQyNDI2Ny8zNTY3MDA3MjYtN2Q0ZjlmZDctM2YzNi00ZTJiLWEzNTItZGRmOWNlMTZiMTVjLnBuZz9qd3Q9ZXlKaGJHY2lPaUpJVXpJMU5pSXNJblI1Y0NJNklrcFhWQ0o5LmV5SnBjM01pT2lKbmFYUm9kV0l1WTI5dElpd2lZWFZrSWpvaWNtRjNMbWRwZEdoMVluVnpaWEpqYjI1MFpXNTBMbU52YlNJc0ltdGxlU0k2SW10bGVUVWlMQ0psZUhBaU9qRTNNall4TURNek5qZ3NJbTVpWmlJNk1UY3lOakV3TXpBMk9Dd2ljR0YwYUNJNklpOHpOalF5TkRJMk55OHpOVFkzTURBM01qWXROMlEwWmpsbVpEY3RNMll6TmkwMFpUSmlMV0V6TlRJdFpHUm1PV05sTVRaaU1UVmpMbkJ1Wno5WUxVRnRlaTFCYkdkdmNtbDBhRzA5UVZkVE5DMUlUVUZETFZOSVFUSTFOaVpZTFVGdGVpMURjbVZrWlc1MGFXRnNQVUZMU1VGV1EwOUVXVXhUUVRVelVGRkxORnBCSlRKR01qQXlOREE1TVRJbE1rWjFjeTFsWVhOMExURWxNa1p6TXlVeVJtRjNjelJmY21WeGRXVnpkQ1pZTFVGdGVpMUVZWFJsUFRJd01qUXdPVEV5VkRBeE1EUXlPRm9tV0MxQmJYb3RSWGh3YVhKbGN6MHpNREFtV0MxQmJYb3RVMmxuYm1GMGRYSmxQVEU0WmpFMlkyRXhNalkzWmpKa1lUWTVOR1F6T1RjellqSTVaV0ZtWWpOaU0yUmxOelF6WkRoa09EQXhaV1UzTkRkaFpqWTBNbU5oT0RRd1kyVXpZVEltV0MxQmJYb3RVMmxuYm1Wa1NHVmhaR1Z5Y3o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dPRGszTjJSbE4ySTRZak1tV0MxQmJYb3RVMmxuYm1Wa1NHVmhaR1Z5Y3oxb2IzTjBKbUZqZEc5eVgybGtQVEFtYTJWNVgybGtQVEFtY21Wd2IxOXBaRDB3SW4wLjdSc3hDUENQWGt6NEZJWkVNQlpMUGFrVTZLZ1ZsVlVILWlpX0tDR2dZMk0=&__proxy_form=0)
When I copy paste the command that was supposed run in the "HISTORY" menu, it runs successfully:
![image](./?url=aHR0cHM6Ly9wcml2YXRlLXVzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8zNjQyNDI2Ny8zNTY3MDE4NjQtZjYwMThlMjgtNWY5OS00M2RmLThhNDctOGI4NzMyMmM3ZjFiLnBuZz9qd3Q9ZXlKaGJHY2lPaUpJVXpJMU5pSXNJblI1Y0NJNklrcFhWQ0o5LmV5SnBjM01pT2lKbmFYUm9kV0l1WTI5dElpd2lZWFZrSWpvaWNtRjNMbWRwZEdoMVluVnpaWEpqYjI1MFpXNTBMbU52YlNJc0ltdGxlU0k2SW10bGVUVWlMQ0psZUhBaU9qRTNNall4TURNek5qZ3NJbTVpWmlJNk1UY3lOakV3TXpBMk9Dd2ljR0YwYUNJNklpOHpOalF5TkRJMk55OHpOVFkzTURFNE5qUXRaall3TVRobE1qZ3ROV1k1T1MwME0yUm1MVGhoTkRjdE9HSTROek15TW1NM1pqRmlMbkJ1Wno5WUxVRnRlaTFCYkdkdmNtbDBhRzA5UVZkVE5DMUlUVUZETFZOSVFUSTFOaVpZTFVGdGVpMURjbVZrWlc1MGFXRnNQVUZMU1VGV1EwOUVXVXhUUVRVelVGRkxORnBCSlRKR01qQXlOREE1TVRJbE1rWjFjeTFsWVhOMExURWxNa1p6TXlVeVJtRjNjelJmY21WeGRXVnpkQ1pZTFVGdGVpMUVZWFJsUFRJd01qUXdPVEV5VkRBeE1EUXlPRm9tV0MxQmJYb3RSWGh3YVhKbGN6MHpNREFtV0MxQmJYb3RVMmxuYm1GMGRYSmxQV0l5WldVNU9HWTBaVGMxWXpCaU9UaGlNelkxTUdZd1pXVTVNVEJsT0Raa056SmpZVFk1TUdGbU9XSTNaak15T0RrNVpHWTRPREZsTVRnMFltSmtNVEFtV0MxQmJYb3RVMmxuYm1Wa1NHVmhaR1Z5Y3oxb2IzTjBKbUZqZEc5eVgybGtQVEFtYTJWNVgybGtQVEFtY21Wd2IxOXBaRDB3SW4wLnlVRmNYOHdobFlCMEVCMzM1eFRzUVd0YUZJSTlibTY0N3lpM3pjY3l0eFU=&__proxy_form=0)
The suspected reason for error, is that there can't be spaces in the command ("result"). E.g. when I added the two lines that are commented below, it would work (and commenting out the original append option_name line).
The text was updated successfully, but these errors were encountered: