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

CLI tools need better argument parsing #378

Closed
smithbone opened this issue Feb 29, 2016 · 7 comments · Fixed by #922
Closed

CLI tools need better argument parsing #378

smithbone opened this issue Feb 29, 2016 · 7 comments · Fixed by #922

Comments

@smithbone
Copy link

The v1/v2 checking code for st-flash is dependent on the number of arguments provided. is listed as an option argument but if you you provide that argument then the argument parser assumes you are talking to a v1 device because 4 arguments are provided.

@gerryqd
Copy link

gerryqd commented May 14, 2016

Just checked the code, seems the info is useless when it is in "write" mode.

Anyway, this is a bug.

@xor-gate
Copy link
Member

xor-gate commented May 14, 2016

Did you fixed this issue with pull request #413 ? I did review it and seems to be fine. I'm currently not very happy how the option parsing is implemented (for all CLI tools) and it needs some more love and reworking. Thanks for looking into it.

@gerryqd
Copy link

gerryqd commented May 14, 2016

Sorry, I did not fix it in #413. Personally, I think the opt parse function should be rewritten. Some cases should be taken into account.

@xor-gate
Copy link
Member

Yeah you are right, I will rename this issue because it is major. I take two small option parsing libraries into account which are both MIT license:

@xor-gate xor-gate changed the title st-flash: write with v2 device fails if size is specified CLI tools need better argument parsing (generic library) May 14, 2016
@xor-gate xor-gate added this to the v1.3.0 milestone May 14, 2016
@xor-gate xor-gate self-assigned this May 17, 2016
@xor-gate
Copy link
Member

Related to #208

@xor-gate xor-gate modified the milestones: v2.1.0, v2.0.0 Aug 3, 2016
@xor-gate xor-gate modified the milestones: Unplanned (Contributions Welcome), v2.1.0 Sep 18, 2016
@Nightwalker-87 Nightwalker-87 modified the milestones: Unplanned (Contributions Welcome), Next Feb 19, 2020
@Nightwalker-87 Nightwalker-87 removed this from the General milestone Feb 21, 2020
@Nightwalker-87 Nightwalker-87 modified the milestone: v1.7.0 Mar 17, 2020
@Nightwalker-87 Nightwalker-87 added this to the Feedback required milestone Mar 20, 2020
@Nightwalker-87
Copy link
Member

Nightwalker-87 commented Apr 11, 2020

@grevaillot: Can you check if this resolves with your recent PR?

@grevaillot
Copy link
Collaborator

i'm a bit puzzled by that piece of code, the v1/v2 stlink handling is a bit broken, the device path is not actually used, and i think it's useless now.

still it would be nice to replace the whole custom opt parsing by something more nice / standard..

@Nightwalker-87 Nightwalker-87 modified the milestones: Old issues, v1.6.2 Apr 12, 2020
@Nightwalker-87 Nightwalker-87 modified the milestones: v1.6.2, v1.6.1 Apr 14, 2020
@Nightwalker-87 Nightwalker-87 changed the title CLI tools need better argument parsing (generic library) CLI tools need better argument parsing Apr 14, 2020
@stlink-org stlink-org locked as resolved and limited conversation to collaborators Apr 14, 2020
@Nightwalker-87 Nightwalker-87 moved this to Done in Release v1.6.1 Apr 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants