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

httpyac-cli - help inconsistent with usage #326

Closed
tl3gr4nd opened this issue Aug 23, 2022 · 2 comments
Closed

httpyac-cli - help inconsistent with usage #326

tl3gr4nd opened this issue Aug 23, 2022 · 2 comments

Comments

@tl3gr4nd
Copy link

tl3gr4nd commented Aug 23, 2022

Hello,

From a prompt, I am in a directory containing:

  • a HTTP file with my requests (group.http)
  • the httpyac configuration file (httpyac.config.js) where are declared my environments

First, it seems that it is possible to execute the request directly without using the send command via httpyac group.http even it is not specified in the help screen (httpyac --help).

Then, when I try to execute my requests via the send command specifying the environment to use, it tells me:

$ httpyac send --line 11 -e dev group.http
error: missing required argument 'fileName'

The help screen for the send command specifies that the fileName should be specified after the options.

When I tried, it seems to work

$ httpyac send group.http --line 11 -e dev
@AnWeber
Copy link
Owner

AnWeber commented Aug 23, 2022

I rely completely on Commander.js for the help text of the CLI output. I actually just pass the existing options along with the help text.

First, it seems that it is possible to execute the request directly without using the send command via httpyac group.http even it is not specified in the help screen (httpyac --help).

Commander.js does not generate automatic output here. It would be possible to override this, but I don't know how other CLI tools do it. Do you have an example for me? Maybe it would make sense to create an issue in Commander.js.

The help screen for the send command specifies that the fileName should be specified after the options.

This is also generated directly by Commander.js. I think Commander.js assumes a different notation here and therefore outputs the usage this way. Use httpyac send --line=11 -e=dev group.http instead of your command without =

@AnWeber
Copy link
Owner

AnWeber commented Aug 24, 2022

The cause is the use of variadic-option in the --env option. This causes the filename to be interpreted as an environment option. One solution according to Commander.js is to change the usage.

@AnWeber AnWeber closed this as completed Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants