AnWeber / httpyac

Command Line Interface for *.http and *.rest files. Connect with http, gRPC, WebSocket and MQTT
https://httpyac.github.io/
MIT License
428 stars 38 forks source link

The --var switch cannot be used as the last switch before the filename #819

Open alekdavis opened 2 weeks ago

alekdavis commented 2 weeks ago

I'm not sure if this is a bug or a feature, but if I specify the --var command-line options, just before the file name, I get the error message complaining about the missing fileName:

image

I suspect this is because it treats the filename as one of the variables. If I move another switch (e.g. -a) before the file name, it works fine. Not a big deal but if this is a feature, maybe need to document it.

AnWeber commented 2 weeks ago

I use commander for all cli args parsing. I will test it with a small example and maybe create a issue

alekdavis commented 5 days ago

I was just helping a coworker and she ran into the same problem when calling CLI as -a -e envname file.http. Basically, it looks like you cannot use any switch that takes multiple arguments before the file name because it then treats the file name as one of the arguments for this switch. Don't know how commander works, but an option would be to have a switch for the file names, like -f file1.http file2.http.