[@types/yargs] command/usage returned type doesn't include the commands defined arguments #67512
Unanswered
segevfiner
asked this question in
Issues with a @types package
Replies: 2 comments 1 reply
-
Thanks for the discussion about "yargs", some useful links for everyone: Pinging the DT module owners: @poelstra, @mizunashi-mana, @pushplay, @JimiC, @steffenvv, @forivall, @ExE-Boss, @Aankhen, @bcoe. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Ping? @poelstra, @mizunashi-mana, @pushplay, @JimiC, @steffenvv, @forivall, @ExE-Boss, @Aankhen, @bcoe |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The returned object from
yargs
parsing include the arguments of the sub-command that was ran. Sometimes instead of usinghandler
, you want to parse the arguments of the main program only, or handle commands in some other way:Inside the handler, you have types for the
file
argument, but outside of it, you don't. Despite bothconsole.log
printing the same.Also, it seems you need to return the
yargs
from thebuilder
argument of the command for types to work, which is not documented in the official yargs docs, and you might want to document this more clearly in the TSDoc of thecommand
andusage
methods.Beta Was this translation helpful? Give feedback.
All reactions