nodeca / argparse

CLI arguments parser for node.js. JS port of python's argparse module.
Other
487 stars 73 forks source link

TypeError: _StoreTrueAction() got an unexpected keyword argument 'metavar' #166

Closed jgod closed 2 years ago

jgod commented 2 years ago

(node:21976) DeprecationWarning: ArgumentParser(): following options are renamed: 'addHelp' -> 'add_help' (Use node --trace-deprecation ... to show where the warning was created) (node:21976) DeprecationWarning: The "version" argument to ArgumentParser is deprecated. Please use add_argument(..., { action: 'version', version: 'N', ... }) instead. (node:21976) DeprecationWarning: _ActionsContainer.addArgument() is renamed to _ActionsContainer.add_argument() (node:21976) DeprecationWarning: add_argument(): following options are renamed: 'defaultValue' -> 'default' (node:21976) DeprecationWarning: use add_argument('--debug', {...}) instead of add_argument([ '--debug' ], { ... }) (node:21976) DeprecationWarning: {action: "storeTrue"} is renamed to {action: "store_true"} D:\dev\myproject\node_modules\argparse\argparse.js:343 throw new TypeError(sub('%s() got an unexpected keyword argument %r', ^

TypeError: _StoreTrueAction() got an unexpected keyword argument 'metavar' at _parse_opts (D:\dev\myproject\node_modules\argparse\argparse.js:343:15) at new _StoreTrueAction (D:\dev\myproject\node_modules\argparse\argparse.js:1459:13) at new _StoreTrueAction (D:\dev\myproject\node_modules\argparse\argparse.js:205:28) at new deprecated (node:internal/util:122:14) at ArgumentParser.add_argument (D:\dev\myproject\node_modules\argparse\argparse.js:2154:22) at ArgumentParser.deprecated (node:internal/util:124:12) at Object.parseArgs (D:\dev\myproject\dist\lib\ui.js:31:16)

puzrin commented 2 years ago

Please provide a minimal reproducible sample. Also read migration doc https://github.com/nodeca/argparse/blob/master/doc/migrate_v1_to_v2.md