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

Provide getopt for platforms that don't support it #3355

Open
miri64 opened this issue Jul 10, 2015 · 18 comments · Fixed by #12457
Open

Provide getopt for platforms that don't support it #3355

miri64 opened this issue Jul 10, 2015 · 18 comments · Fixed by #12457
Assignees
Labels
Area: POSIX Area: POSIX API wrapper Community: good first issue This issue is good for newcomers to RIOT to be addressed / implemented Platform: AVR Platform: This PR/issue effects AVR-based platforms Platform: MSP Platform: This PR/issue effects MSP-based platforms Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Type: new feature The issue requests / The PR implemements a new feature for RIOT

Comments

@miri64
Copy link
Member

miri64 commented Jul 10, 2015

newlib provides getopt.h which would implementing commands like ping6 far easier. Sadly msp430-libc and avr-libc do not provide this header. Conclusively, a lightweight implementation for those platforms would be much appreciated.

@miri64 miri64 added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Platform: MSP Platform: This PR/issue effects MSP-based platforms Area: POSIX Area: POSIX API wrapper Type: new feature The issue requests / The PR implemements a new feature for RIOT Platform: AVR Platform: This PR/issue effects AVR-based platforms labels Jul 10, 2015
@miri64 miri64 added this to the Release NEXT MAJOR milestone Jul 10, 2015
@N8Fear
Copy link

N8Fear commented Jul 11, 2015

Did you consider to take the getopt stuff from musl? I think musl is a very neatly written libc implementation. It's also relatively modular and doesn't assume too much. It's also MIT-licensed so license shouldn't be a problem either.

@mayman99
Copy link
Contributor

I've wrote the lib for the avr, I used some of musl's code and some public domain code plus my own code, so about the licence thing, is there a problem with that -using MIT and public domain code-, do I mention who's code did I use, even thought I did modify like half of it ?
Forgive my so many questions =D, I'm new to riot and to open source development in general.
Thanks.

@miri64
Copy link
Member Author

miri64 commented Oct 16, 2015

About MIT: there are several variants of the MIT license (most notably the Expat and the X11 license, both are compatible to (LGPLv2.1)[http://www.gnu.org/licenses/license-list.html]). If it is compatible to LGPLv2.1 it should be no problem to include them. Public Domain should be no problem either.

@mayman99 mayman99 mentioned this issue Oct 18, 2015
@mayman99
Copy link
Contributor

thanks for the info about the licensing thing.
I've started a pull request #4106 . but i'm still having some doxgyen errors right now, i'll try to fix them asap.

@OlegHahm OlegHahm removed this from the Release 2015.12 milestone Dec 4, 2015
@OlegHahm OlegHahm assigned BytesGalore and unassigned N8Fear Dec 4, 2015
@ssudarsh
Copy link

ssudarsh commented Apr 1, 2017

Hi ,
I am complete newbie to RIOT & open source . Currently looking at the PRs labeled "Newbie-Task-Candidate".
I wanted to know if this PR# is still open to work on and suggestions how proceed with it?
I see some changes were submitted for review in #4106.

Thanks

@miri64
Copy link
Member Author

miri64 commented Apr 2, 2017

@sudarshansrinivasan for avr-libc have a look at the comment by @N8Fear above. The implementation (the c-file) should go to cpu/atmega_common and the header to cpu/atmega_common/include. The idea is to implement a feature interchangable with libc's getopt functionality: https://www.gnu.org/software/libc/manual/html_node/Getopt.html (edit: wrong link posted before, sorry).

@gebart how is the status for this on msp430 (+newlib?)?

@miri64
Copy link
Member Author

miri64 commented Apr 2, 2017

(getopt suffices for now, no need for getopt_long)

@jnohlgard
Copy link
Member

I don't know about msp430 libc, but I guess newlib on msp430 has it if newlib on arm has it.

@miri64
Copy link
Member Author

miri64 commented Apr 2, 2017

I have to say since #6778 I'm pretty confused how newlib and msp430 work now ;-). But that's OT, I know.

@virajsahai
Copy link

Hello..
I have written an implementation for this. Can anyone tell me how to test it?

This was referenced May 23, 2018
@miri64 miri64 added Community: good first issue This issue is good for newcomers to RIOT to be addressed / implemented and removed Newbie-Task-Candidate labels Sep 30, 2018
@stale
Copy link

stale bot commented Aug 10, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions.

@stale stale bot added the State: stale State: The issue / PR has no activity for >185 days label Aug 10, 2019
@miri64 miri64 removed the State: stale State: The issue / PR has no activity for >185 days label Aug 10, 2019
@miri64
Copy link
Member Author

miri64 commented Aug 10, 2019

Fixed by #9538

@stale
Copy link

stale bot commented Feb 11, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions.

@stale stale bot added the State: stale State: The issue / PR has no activity for >185 days label Feb 11, 2020
@miri64
Copy link
Member Author

miri64 commented Feb 11, 2020

Fixed partly by #12457?

@stale stale bot removed the State: stale State: The issue / PR has no activity for >185 days label Feb 11, 2020
@miri64
Copy link
Member Author

miri64 commented Aug 5, 2020

avr-libc still does not support this AFAIK.

@miri64 miri64 reopened this Aug 5, 2020
@stale
Copy link

stale bot commented Feb 9, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions.

@stale stale bot added the State: stale State: The issue / PR has no activity for >185 days label Feb 9, 2021
@miri64 miri64 removed the State: stale State: The issue / PR has no activity for >185 days label Feb 10, 2021
@MrKevinWeiss MrKevinWeiss added this to the Release 2021.07 milestone Jun 22, 2021
@MrKevinWeiss MrKevinWeiss removed this from the Release 2021.07 milestone Jul 15, 2021
@stale
Copy link

stale bot commented Mar 2, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions.

@stale stale bot added the State: stale State: The issue / PR has no activity for >185 days label Mar 2, 2022
@stale stale bot closed this as completed Apr 19, 2022
@maribu
Copy link
Member

maribu commented Apr 19, 2022

Is only avrlibc missing getopt? Now that avrlibc is actively maintained again, one could try to upstream getopt instead.

Anyway, I think getopt is part of the POSIX environment that we can provide to ease life for developers new to RIOT. So I guess we should reopen this.

@maribu maribu reopened this Apr 19, 2022
@stale stale bot removed the State: stale State: The issue / PR has no activity for >185 days label Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: POSIX Area: POSIX API wrapper Community: good first issue This issue is good for newcomers to RIOT to be addressed / implemented Platform: AVR Platform: This PR/issue effects AVR-based platforms Platform: MSP Platform: This PR/issue effects MSP-based platforms Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
10 participants