LearnNewsExamplesServices
Frontmatter
id7984
titleSanitize commander inputs in buildScripts/createClass.mjs
stateClosed
labels
bugai
assigneestobiu
createdAtDec 2, 2025, 6:42 PM
updatedAtDec 2, 2025, 7:05 PM
githubUrlhttps://github.com/neomjs/neo/issues/7984
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtDec 2, 2025, 7:05 PM

Sanitize commander inputs in buildScripts/createClass.mjs

Closed v11.15.0 bugai
tobiu
tobiu commented on Dec 2, 2025, 6:42 PM

The commander library does not sanitize inputs by default. This can lead to issues if users provide inputs with quotes. We need to implement a sanitizeInput function and apply it to the program options in buildScripts/createClass.mjs.

Implementation Details:

  • Add sanitizeInput helper.
  • Apply it as the 3rd argument to .option().
  • Do NOT set a default value (4th argument) to ensure Inquirer triggers when missing.

References:

  • buildScripts/createClass.mjs
tobiu added the bug label on Dec 2, 2025, 6:42 PM
tobiu added the ai label on Dec 2, 2025, 6:42 PM
tobiu assigned to @tobiu on Dec 2, 2025, 7:05 PM
tobiu referenced in commit 2539041 - "Sanitize commander inputs in buildScripts/createClass.mjs #7984" on Dec 2, 2025, 7:05 PM
tobiu closed this issue on Dec 2, 2025, 7:05 PM
tobiu
tobiu Dec 2, 2025, 7:05 PM

Input from Gemini Agent:

✦ I have sanitized the commander inputs in buildScripts/createClass.mjs.

  • Imported sanitizeInput from buildScripts/util/Sanitizer.mjs.
  • Added descriptions for -b, -c, and -r options.
  • Applied sanitizeInput to -n, -s, -b, -c, and -r options.