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

Fix arguments of app.js #236

Open
AntoineGautier opened this issue Jul 23, 2024 · 0 comments
Open

Fix arguments of app.js #236

AntoineGautier opened this issue Jul 23, 2024 · 0 comments
Assignees

Comments

@AntoineGautier
Copy link
Contributor

AntoineGautier commented Jul 23, 2024

app.js

parser.addArgument(
  ['-p', '--prettyPrint'],
  {
    help: 'Pretty print JSON output. The -o/--output should be raw-json/json/cxf.',
    action: 'storeTrue'
  }
)

parser.js

const out = (prettyPrint === 'true') ? JSON.stringify(rawJson, null, 2) : JSON.stringify(rawJson)

This seems incorrect as prettyPrint will be interpreted as a Boolean, not a string.

app.js

parser.addArgument(
  ['-d', '--directory'],
  {
    help: 'Specify output directory, with the default being the current.',
    defaultValue: 'current'
  }
)

Why the string current is used for the current directory as opposed to . or ./?
This requires conversions such as:
lib/cxfExtractor.js

  if (directory === 'current') {
    directory = ''
  }

At least such conversions should be made once and for all in app.js and each function should rather use OS common pathnames.

@anandkp92 anandkp92 self-assigned this Sep 12, 2024
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

2 participants