Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add positional options support #61

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
marcrittinghaus wants to merge 1 commit into cofyc:master
base: master
Choose a base branch
Loading
from marcrittinghaus:mritting/pr_positional_options

Conversation

@marcrittinghaus
Copy link

@marcrittinghaus marcrittinghaus commented Dec 28, 2022

Currently, positional options are not explicitly supported but just remain as unparsed arguments. This commit adds support for positional arguments so that these are treated like other options including parsing and listing in the help output.

Positional arguments can be defined as regular options but with the OPT_POSITIONAL flag:

 OPT_GROUP("Positional options"),
 OPT_INTEGER(0, "posi", &posi, "positional integer", NULL, 0, OPT_POSITIONAL),
 OPT_STRING(0, "poss", &poss, "positional string", NULL, 0, OPT_POSITIONAL),

The long name is used in error messages if the argument cannot be parsed.

This PR addresses issue: #46

Currently, positional options are not explicitly supported but just
remain as unparsed arguments. This commit adds support for positional
arguments so that these are treated like other options including
parsing and listing in the help output.
Signed-off-by: Marc Rittinghaus <marc.rittinghaus@unikraft.io>
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: marcrittinghaus
To complete the pull request process, please assign cofyc
You can assign the PR to them by writing /assign @cofyc in a comment when ready.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@cofyc-bot cofyc-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Dec 28, 2022
Copy link
Owner

cofyc commented Dec 29, 2022

@tripulse what do you think?

Copy link

Why isn't this approved yet?

LukeDeWaal reacted with confused emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /