Closed JamesMessinger closed 8 years ago
ping @sindresorhus might this be another regression due to switching from nopt
to meow
?
yo electron -o
Passes the following to env.run(args, opts);
:
['electron']
{
o: true
}
While with nopt
it passed:
['electron']
{
o: true,
argv: {
remain: ['electron'],
cooked: ['electron', '-o'],
original: ['electron', '-o']
}
}
The .run()
documentation is a bit limited, so not sure if this ever worked or should have. ?
Running yo --help works fine, but yo -h doesn't work.
That's intentional.
Alright then, classifying as a bug. Feel free to dig the code if you want this resolved faster.
@sindresorhus - If it's intentional that yo -h
doesn't work, then why is it listed as an option when in yo --help
:
~: yo --help
Usage: yo GENERATOR [args] [options]
General options:
-h, --help # Print generator's options and usage
-f, --force # Overwrite files that already exist
I guess that help text needs to be updated.
https://github.com/yeoman/yo/blob/master/lib/usage.txt. As you can see it's already updated. @BigstickCarpet, could you try updating yo
?
Latest version is 1.4.6, right? It still shows the old usage text
Hm, yeah. We haven't pushed out a new release since that changed.
It was updated https://github.com/yeoman/yo/commit/5905f6225e8ac1644dbcf58c5d45f16cc9f3c251 What is interactive help?
Hey, just checked into that issue. This is effectively a bug and it's not just about fixing the text. Aliases don't work anymore. When calling this.option()
in a generator, there's always been a choice to add a shortname alias.
This feature should work as before. We'll need to investigate.
My yo version is 1.7.0, but I have same problem. Aliases works same as name.
If I have option "bundle" with alias "b" and run generator with arument "-b foo", then my options object will be {bundle: undefined, b:'foo'}
npm -v 3.8.3
@Nitro-N the yo version doesn't matter. It's about the yeoman-generator
version.
@SBoudrias Yep! My mistake, sorry.
I have an option with an alias, like this:
When I run
yo mygenerator --help
, I see the following output:If I run my generator with
yo mygenerator --opt
, it works fine.generator.options.opt
istrue
, as expected. But if I run my generator withyo mygenerator -o
, it doesn't work.generator.options.opt
isundefined
. It seems like option aliases aren't working.The same applies for the
--help
option. Runningyo --help
works fine, butyo -h
doesn't work.