Skip to content

getopt: document special symbols that should not be used as option ch… #3697

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cgoesche
Copy link
Contributor

@cgoesche cgoesche commented Aug 22, 2025

getopt(3) routines return ? or : when an unknown option character is encountered or an option is missing its required argument, respectively. It also disallows ; as an option character. Documenting this makes users aware that they may not use these reserved symbols as option characters, e.g. -? which is used in some older programs.

Addresses: #2995
Addresses: #2594

…aracters

getopt(3) routines return `?` or `:` when an unknown option character is encountered
or an option is missing its required argument, respectively. It also disallows
`;` as an option character. Documenting this makes users aware that they may not use
these reserved symbols as option characters, e.g. `-?` which is used in some older programs.

Addresses: util-linux#2995
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
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.

1 participant