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

Discrepancy in error message vs help output #3106

Closed
chrisortman opened this issue Sep 7, 2017 · 5 comments
Closed

Discrepancy in error message vs help output #3106

chrisortman opened this issue Sep 7, 2017 · 5 comments
Labels
Milestone

Comments

@chrisortman
Copy link

chrisortman commented Sep 7, 2017

Hello - thanks for reporting an issue with Habitat.

In order to help us troubleshoot the issue, please be sure to include the following information if applicable:

  • [bento/cent7.3 ] The OS (including version) where you are running any of the Habitat commands.

  • [n/a ] Debug/backtrace of the command you are trying to run. You can set the following environment variables before running the hab command to generate a trace:

      RUST_LOG=debug RUST_BACKTRACE=1 hab ...
    
  • [n/a ] Current Habitat environment variables where the hab command or supervisor is running. These can be gathered using:

      env | grep HAB | grep -v HAB_AUTH_TOKEN
    
/home/vagrant # hab --version
hab 0.30.2/20170822232349

This is nitpicky but ….

/home/vagrant # hab svc load --help
hab-sup-load
Load a service to be started and supervised by Habitat from a package or artifact. Services started in this manner will persist through Supervisor restarts.

USAGE:
    hab-sup load [FLAGS] [OPTIONS] <PKG_IDENT>

Says pass flags and options before package

But

/home/vagrant # hab svc load --strategy at-once --channel stable --bind base:simple-node-1.default chrisortman/dependent-node-1
error: The following required arguments were not provided:
    <PKG_IDENT>

USAGE:
    hab-sup load <PKG_IDENT> --bind <BIND>... --channel <CHANNEL> --strategy <STRATEGY>

Results in an error and the error message has package first

https://github.com/chrisortman/hab-test if you need the environment

Aha! Link: https://chef.aha.io/features/APPDL-90

@fnichol
Copy link
Collaborator

fnichol commented Sep 14, 2017

That's a pretty interesting inconsistency with the 2 usages. We're using a CLI parsing library under the hood (PSA: clap is pretty amazing), but I think I might know why (possibly fixable): the last option that person provided was --bind which can take zero, one, or more values. I'm wondering if the CLI parser thinks the package identifier at the end is another --bind value.

Does slightly changing the order of your options change the behavior? Specifically, not putting --bind as the last option before the PKG_IDENT like:

hab svc load \
  --strategy at-once \
  --bind base:simple-node-1.default \
  --channel stable \
  chrisortman/dependent-node-1

@chrisortman
Copy link
Author

Yes it does, if I run it as you have specified it works.

@nellshamrell nellshamrell added this to the Help Wanted milestone Sep 26, 2017
@rsertelon
Copy link
Contributor

I think this is the same issue as in #2221

@stale
Copy link

stale bot commented Apr 3, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We value your input and contribution. Please leave a comment if this issue still affects you.

@stale stale bot added the Stale label Apr 3, 2020
@stale
Copy link

stale bot commented May 8, 2021

This issue has been automatically closed after being stale for 400 days. We still value your input and contribution. Please re-open the issue if desired and leave a comment with details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants