Skip to content

Add an option to print only version info#1507

Open
mhogomchungu wants to merge 4 commits into
quickjs-ng:masterfrom
mhogomchungu:master
Open

Add an option to print only version info#1507
mhogomchungu wants to merge 4 commits into
quickjs-ng:masterfrom
mhogomchungu:master

Conversation

@mhogomchungu
Copy link
Copy Markdown

No description provided.

Comment thread qjs.c
@@ -392,7 +392,7 @@ void help(void)
" --memory-limit n limit the memory usage to 'n' Kbytes\n"
" --stack-size n limit the stack size to 'n' Kbytes\n"
"-q --quit just instantiate the interpreter and quit\n", JS_GetVersion());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to add the -v / --version here.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Comment thread qjs.c Outdated
help(0);
}
if (opt == 'v' || !strcmp(longopt, "version")) {
printf("QuickJS-ng version %s\n",JS_GetVersion());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just print the version, no extra text, it will make it much easier for scripts that want to parse it...

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

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

Successfully merging this pull request may close these issues.

2 participants