oclif / plugin-commands

MIT License
8 stars 3 forks source link

`args` are stripped away when using the global `--json` flag #764

Closed justinwilaby closed 1 week ago

justinwilaby commented 2 weeks ago

Describe the bug When outputting commands with the --json flag, all commands that extend a base class show empty args. note commenting out this line fixes the problem.

To Reproduce

  1. Download and install the latest Heroku CLI
  2. run heroku commands --json > herokuCommands.json
  3. Open the herokuCommands.json in an editor or IDE
  4. Observe all but 7 commands show "args": {}

Expected behavior args should not be stripped away. Currently, the Heroku CLI should have 200+ commands with args.

Additional context This problem seems to occur for all commands that extend a base class. This defect also seems to omit ARGUMENTS from the documentation creation process when oclif is used to produce docs. After digging, the doc creation process does not use the affected code branch mentioned here. This problem is limited to the json output.

git2gus[bot] commented 2 weeks ago

This issue has been linked to a new work item: W-16844507