https://github.com/samuelmarks/freebsd-getopt-portable
FreeBSD's `getopt` and `getopt_long` ported to Windows & others
https://github.com/samuelmarks/freebsd-getopt-portable
Last synced: 3 months ago
JSON representation
FreeBSD's `getopt` and `getopt_long` ported to Windows & others
- Host: GitHub
- URL: https://github.com/samuelmarks/freebsd-getopt-portable
- Owner: SamuelMarks
- License: other
- Created: 2023-05-21T23:35:39.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-07-01T16:25:44.000Z (about 3 years ago)
- Last Synced: 2025-08-22T23:19:51.460Z (11 months ago)
- Language: C
- Homepage:
- Size: 66.4 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-BSD.md
Awesome Lists containing this project
README
getopt_freebsd
==============
[](https://opensource.org/licenses/BSD-2-Clause)
[](https://en.wikipedia.org/wiki/C89_(C_version))
`getopt` and `getopt_long` are nice. But MSVC doesn't have them.
Documentation: https://man.freebsd.org/cgi/man.cgi?getopt_long(3)
BSD-2-Clause: This ports their implementation to Windows from FreeBSD's source tree at [freebsd/freebsd-src@`046d8d8`](https://github.com/freebsd/freebsd-src/commit/046d8d89ed1956944b12ec4f0580c30bc202bbfb).
Apache-2.0: On non-Cygwin Windows this uses `getprogname` at [apple/swift-corelibs-libdispatch@`7fb9d5c`](https://github.com/apple/swift-corelibs-libdispatch/commit/7fb9d5ceea562d60fe34ec55b6b165ae5aca38eb)
Support includes:
- **Windows**
- MSVC 2022* (tested on x86 and x64)
- MinGW (tested on x86 and x64)
- Cygwin
*should support all versions down to ~2010 also.
PS: On Linux, BSD, macOS, SunOS and others with `unistd.h` depending on this library should still work; this just becomes a header-only lib with `#include `.
---
## License
Licensed under BSD 2 clause ([LICENSE-BSD-2](LICENSE-BSD-2) or )
Except for getprogname which is Apache-2.0 from https://github.com/apple/swift-corelibs-libdispatch
### Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, shall be licensed as above, without any
additional terms or conditions.