-
Notifications
You must be signed in to change notification settings - Fork 63
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
Improve command line interface #179
base: main
Are you sure you want to change the base?
Conversation
compiler/prefs.js
Outdated
help: 1 | ||
}, | ||
{ | ||
arg: 'help-hidden', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--help-verbose
maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, also a good idea.
compiler/prefs.js
Outdated
|
||
for (const x of process.argv) { | ||
if (x[0] !== '-') continue; | ||
export function parseArgs(argv, optionsOnly = false, file) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually Porffor uses the export const parseArgs = (...) => ...
format, not function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I guess a simple change.
runner/repl.js
Outdated
globalThis.valtype = Options.valtype ?? 'f64'; | ||
|
||
const color = (txt, colors) => { | ||
if (!(process.stdout.isTTY ?? true)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this require changes to index.html
's setProcess
method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I have a better version in prefs.js but I don't think repl gets used within the website?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, you're right, I misread which file this was in.
Re-writes the command line parser (prefs.js) and adds a more helpful help message. Prefs is also renamed to Options, mostly so that I could make sure that nobody was using Prefs anymore. The help message is currently very unorganized and many options that should be invisible by default aren't - however this is easy to fix by shuffling around a few elements and adding a few
hide: true
s and a few{ separator: '...' }
s.