Skip to content
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

helics_recorder (but not helics_app) limited command-line parsing #2724

Closed
trevorhardy opened this issue Jan 15, 2025 · 1 comment
Closed
Labels
bug Issue concerning incorrect code operation

Comments

@trevorhardy
Copy link
Contributor

Describe the bug
helics_recorder (and probably helics_player, potentially many others), don't appear to parse command-line options as flexibly as we intend. Specifically, it appears spaces of any kind in the options are causing problems. For example, -o output.txt produces the error below.

Input:

helics_recorder recorder_config.txt --output recorder_output.txt 

Output:

libc++abi: terminating due to uncaught exception of type CLI::ArgumentMismatch: --output: 1 required TEXT missing

What is the expected behavior?
The --help indicates -o and --output= should be equally valid but, through testing, we found that putting any space after the option (-o or --output) produces the above error.

Works:

helics_recorder recorder_config.txt --output=recorder_output.txt 
helics_recorder recorder_config.txt -orecorder_output.txt 

Doesn't work:

helics_recorder recorder_config.txt --output recorder_output.txt 
helics_recorder recorder_config.txt -o recorder_output.txt 

To Reproduce
Steps to reproduce the behavior:
Change the fundamental default example runner file to add a helics_recorder:

{
  "name": "fundamental_default",
  "broker": true,
  "federates": [
    {
      "directory": ".",
      "exec": "python -u Charger.py 1",
      "host": "localhost",
      "name": "Charger"
    },
    {
      "directory": ".",
      "exec": "python -u Battery.py 1",
      "host": "localhost",
      "name": "Battery"
    },
    {
      "directory": ".",
      "exec": "helics_recorder recorder_config.txt -o recorder_output.txt",
      "host": "localhost",
      "name": "helics_recorder"
    }
  ]
}

Environment (please complete the following information):

  • Operating System: macOS 14.7.2
  • Language Extension: Python
  • what compiler or setup process did you use: build from source + pip install helics
$ helics --version

helics, version 3.6.0

Python HELICS version 3.6.0

HELICS Library version 3.6.0 (2024-12-09)

HELICS Apps version 3.6.0
$ helics_app --version

Additional context and information
Co-incidentally, during the testing for #2723, we found that "helics_app" (rather than "helics_recorder") didn't seem to exhibit this problem.

@trevorhardy trevorhardy added the bug Issue concerning incorrect code operation label Jan 15, 2025
@trevorhardy
Copy link
Contributor Author

Fixed in #2726

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue concerning incorrect code operation
Projects
None yet
Development

No branches or pull requests

1 participant