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

Carton intercepts --help, --version, and probably others #151

Open
rkleemann opened this issue Oct 29, 2013 · 7 comments
Open

Carton intercepts --help, --version, and probably others #151

rkleemann opened this issue Oct 29, 2013 · 7 comments

Comments

@rkleemann
Copy link

When run with carton, my script cannot do anything with the --help and --version command parameters, as carton intercepts them and prints out it's own help and version information.

The command I'm using: carton exec ./my-script.pl --help

Carton should stop processing command line options once it discovers an exec, as everything after that point should be passed, unmolested, to the process.

@miyagawa
Copy link
Contributor

Use carton exec -- ./myscript.pl --help.

@rkleemann
Copy link
Author

That feels like a hack.

@miyagawa
Copy link
Contributor

It is a pretty normal and standard behavior for POSIX tools that use getopt
or similar.

@miyagawa
Copy link
Contributor

miyagawa commented Nov 7, 2013

although -- does and will always work to separate command options, i will make a change to not intercept --help and --version specifically. Reopened the bug for tracking.

@miyagawa miyagawa reopened this Nov 7, 2013
@maxhq
Copy link

maxhq commented Jul 28, 2016

I just stumbled upon this. The main problem IMHO is that from a user's point of view the behaviour changes depending on the arguments (s)he give to the script:
carton exec bin/myscript --yoworks but
carton exec bin/myscript --help doesn't.

I think there are two reasons these two arguments could just be dropped:

  1. carton exec --versionand carton exec --help are most likely not used in any scripts in the wild
  2. You can always do carton help exec which feels natural for e.g. git users.

I am not sure what to do with --verbose though.

@miyagawa
Copy link
Contributor

Well, for now just use --, that will always work.

@s1037989
Copy link

s1037989 commented Jun 3, 2017

Yes, -- works for me. Curious tho why it's intercepting -n? I went thru all the lower case letters and it intercepted -h and -v obviously, but why -n?

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

4 participants