cta-observatory / ctapipe

Low-level data processing pipeline software for CTAO or similar arrays of Imaging Atmospheric Cherenkov Telescopes
https://ctapipe.readthedocs.org
BSD 3-Clause "New" or "Revised" License
63 stars 266 forks source link

Confusing error message on incorrect parameters #2446

Open kosack opened 8 months ago

kosack commented 8 months ago

Describe the bug

Including a parameter that doesn't exist gives an unexpected error message (I found this when testing #2444 )

ctapipe-process --input events.simtel.zst --config base_config.yaml \
    --config stage1_config.yaml --output events.dl1.h5 \
    --log-level=INFO --wrong-parameter 
    --max-events=100 --overwrite

ctapipe-process: error: argument --wrong-parameter: expected one argument

Expected behavior

Should say --wrong-parameter is not a valid option or similar.

kosack commented 8 months ago

Indeed if I use --wrong-parameter=6 the message is more clear:

ctapipe-process: error: unrecognized arguments: --wrong-parameter=6

So it's only in the case where the parameter is not set.