GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add more robust option parsing [WIP] by evanlucas · Pull Request #1726 · nodejs/node

Conversation

@evanlucas

@evanlucas evanlucas commented May 18, 2015

Copy link
Copy Markdown
Contributor

This is a start for adding more robust option parsing. I wanted to go ahead and open this to get some feedback on the direction.

Note: this is by no means complete and there are failing tests from it currently

I have included the option parser found at https://github.com/JGiard/tclap. I had to make some modifications to allow passing through v8 options.

TODO

  • Migrate debug option parsing
  • Make sure the --icu-data-dir flag works as intended

Questions

  1. Is this a direction that we are interested in going?
  2. This library throws exceptions in the event a flag that requires an argument fails to validate. So, it requires removing the -fno-exceptions flag. Is that acceptable?

In general, I would appreciate any/all feedback to see if this is something that should be pursued.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
evanlucas added 2 commits May 18, 2015 01:27
@evanlucas
deps: add tclap for option parsing
64878e8
@evanlucas
src: add more option parsing
2e38f84
@silverwind

silverwind commented May 18, 2015

Copy link
Copy Markdown
Contributor

My gut feeling tells me that if you have to modify the parser, it may not be the right tool for the job. What were the issues with the v8 options?

Generally, I'm +1 for a better parser that can take arguments in any order.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@evanlucas

evanlucas commented May 18, 2015

Copy link
Copy Markdown
Contributor Author

The only change made was to allow getting the unmatched flags. Otherwise, we would have to define all of the v8 flags individually :/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bnoordhuis

bnoordhuis commented May 18, 2015

Copy link
Copy Markdown
Member

This library throws exceptions in the event a flag that requires an argument fails to validate. So, it requires removing the -fno-exceptions flag. Is that acceptable?

I'd say no. If nothing else, it's going to add several hundreds of kilobytes of mostly unused unwind info to the binary.

You could work around that by breaking out the option parsing code in node.cc into a separate file and only enabling exceptions for that particular file. You probably have to turn it into a separate static_library target for that to work.

Also, 5,000 lines of mostly unvetted code... surely there must be something simpler?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@brendanashworth brendanashworth added the c++ Issues and PRs that require attention from people who are familiar with C++. label May 18, 2015
@evanlucas

evanlucas commented May 19, 2015

Copy link
Copy Markdown
Contributor Author

Maybe something more getopt-like?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Fishrock123

Fishrock123 commented May 19, 2015

Copy link
Copy Markdown
Contributor

@bnoordhuis mentioned two options here: #1691 (comment)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Fishrock123

Fishrock123 commented May 20, 2015

Copy link
Copy Markdown
Contributor

See also #1197

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@evanlucas

evanlucas commented May 20, 2015

Copy link
Copy Markdown
Contributor Author

I guess the biggest difficulty I'm seeing is distinguishing between v8 arguments and arguments that should be in argv vs exec_argv. Not sure how trivial of a task this is going to be. I also see moving this from the current implementation to have breaking changes.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@evanlucas evanlucas mentioned this pull request May 26, 2015
src: add getopt option parser #1804
Merged
@evanlucas

evanlucas commented May 26, 2015

Copy link
Copy Markdown
Contributor Author

closing in favor of #1804

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@evanlucas evanlucas closed this May 26, 2015
brendanashworth referenced this pull request in brendanashworth/io.js May 28, 2015
@brendanashworth
src: remove old code
e544c30
The Socket writable only change was added and implemented in the
constructor around 5885f46, but this was never removed.

The libev counter issue is no longer prudent; the test remains in
test/sequential/test-regress-GH-1726.
brendanashworth referenced this pull request May 30, 2015
@brendanashworth
src: remove old code
a65762c
The Socket writable only change was added and implemented in the
constructor around 5885f46, but this was never removed.

The libev counter issue is no longer prudent; the test remains in
test/sequential/test-regress-GH-1726.

PR-URL: #1819
Reviewed-By: Ben Noordhuis <[email protected]>
@ryzokuken ryzokuken mentioned this pull request Mar 6, 2018
test: rename regression tests with descriptive file names #19161
Closed
8 tasks done
ryzokuken added a commit to ryzokuken/node that referenced this pull request Mar 6, 2018
@ryzokuken
test: rename test-regress-nodejsGH-1726
51e7956
Rename the test appropriately alongside mentioning the subsystem
Also, make a few basic changes to make sure the test conforms
to the standard test structure

Refs: nodejs#19105
Refs: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#test-structure
devsnek pushed a commit that referenced this pull request Mar 8, 2018
@ryzokuken @devsnek
test: rename test-regress-GH-1726
14d670f
Rename the test appropriately alongside mentioning the subsystem
Also, make a few basic changes to make sure the test conforms
to the standard test structure

Refs: #19105
Refs: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#test-structure

PR-URL: #19161
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
targos pushed a commit that referenced this pull request Mar 17, 2018
@ryzokuken @targos
test: rename test-regress-GH-1726
effb121
Rename the test appropriately alongside mentioning the subsystem
Also, make a few basic changes to make sure the test conforms
to the standard test structure

Refs: #19105
Refs: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#test-structure

PR-URL: #19161
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
@targos targos mentioned this pull request Mar 18, 2018
v9.9.0 proposal #19428
Merged
MylesBorins pushed a commit that referenced this pull request Mar 20, 2018
@ryzokuken @MylesBorins
test: rename test-regress-GH-1726
fa43d2f
Rename the test appropriately alongside mentioning the subsystem
Also, make a few basic changes to make sure the test conforms
to the standard test structure

Refs: #19105
Refs: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#test-structure

PR-URL: #19161
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
MayaLekova pushed a commit to MayaLekova/node that referenced this pull request May 8, 2018
@ryzokuken @MayaLekova
test: rename test-regress-nodejsGH-1726
ae0092a
Rename the test appropriately alongside mentioning the subsystem
Also, make a few basic changes to make sure the test conforms
to the standard test structure

Refs: nodejs#19105
Refs: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#test-structure

PR-URL: nodejs#19161
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
trivikr pushed a commit to trivikr/node that referenced this pull request Sep 15, 2018
@ryzokuken @MylesBorins
test: rename test-regress-nodejsGH-1726
20a4ec8
Rename the test appropriately alongside mentioning the subsystem
Also, make a few basic changes to make sure the test conforms
to the standard test structure

Refs: nodejs#19105
Refs: https://github.com/nodejs/node/blob/master/doc/guides/writing-tests.md#test-structure

PR-URL: nodejs#19161
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
This was referenced Jul 27, 2020
[Snyk] Security upgrade marked from 0.3.6 to 1.1.1 GregorFendt/node#6
Open
[Snyk] Security upgrade marked from 0.3.19 to 1.1.1 s4sc/node#15
Open
[Snyk] Security upgrade marked from 0.3.19 to 1.1.1 scality/node#9
Open
[Snyk] Security upgrade marked from 0.3.6 to 1.1.1 KamilPolivka/node#8
Open
[Snyk] Security upgrade marked from 0.3.19 to 1.1.1 erdun/node#25
Open
[Snyk] Security upgrade marked from 0.3.19 to 1.1.1 enterstudio/node#15
Open
This was referenced Jul 28, 2020
[Snyk] Security upgrade marked from 0.6.3 to 1.1.1 adamlaska/node#39
Open
[Snyk] Security upgrade marked from 0.3.19 to 1.1.1 solebox/node#16
Open
[Snyk] Security upgrade marked from 0.3.6 to 1.1.1 saeedahassan/node#22
Open
[Snyk] Security upgrade marked from 0.3.6 to 1.1.1 olegnn/node#23
Open
[Snyk] Security upgrade marked from 0.3.19 to 1.1.1 pmq20/node#25
Open
[Snyk] Security upgrade marked from 0.3.6 to 1.1.1 saurabharch/node#9
Open
[Snyk] Security upgrade marked from 0.3.19 to 1.1.1 mkg20001/node#22
Open
@snyk-bot snyk-bot mentioned this pull request Aug 11, 2020
[Snyk] Fix for 3 vulnerabilities turkdevops/node#11
Merged
@snyk-bot snyk-bot mentioned this pull request Jan 20, 2023
[Snyk] Upgrade commander from 2.11.0 to 9.4.1 Supermajestcd/node#3
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

c++ Issues and PRs that require attention from people who are familiar with C++.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@evanlucas @silverwind @bnoordhuis @Fishrock123 @brendanashworth
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.