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

more options to parse #20

Merged
merged 11 commits into from
Nov 6, 2024
Merged

more options to parse #20

merged 11 commits into from
Nov 6, 2024

Conversation

hannesm
Copy link
Contributor

@hannesm hannesm commented Nov 4, 2024

No description provided.

@hannesm
Copy link
Contributor Author

hannesm commented Nov 6, 2024

Maybe, if @reynir has some time, could do a review? Thanks a lot.

@reynir reynir self-requested a review November 6, 2024 14:03
reynir and others added 4 commits November 6, 2024 16:27
A local `ignore_line` was shadowing the outer `ignore_line` which was
what we want for parsing comments; so the local `ignore_line` is renamed
to `ignore_directive`.

lease_time without a 'm', 'h' or similar qualifier should not expect
`end_of_input`.

All `Angstrom.choice` invocations now receive a `~failure_msg` argument
for better error messages.
@reynir
Copy link
Contributor

reynir commented Nov 6, 2024

I pushed some changes.

About comments, it seems you can have comments at the end of lines as long as there is whitespace immediately before the #:

bind-interfaces # this is a comment

Otherwise it's not allowed

bind-interfaces# this is an illegal comment

I'm not sure how to adapt the parser for this. I think it's fine to defer that to another PR.

Copy link
Contributor

@reynir reynir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks good to me.

Comment on lines 54 to 59
let interface =
let doc =
Arg.info ~docs:ignored ~doc:"Interface to listen on." [ "interface" ]
in
Mirage_runtime.register_arg
Arg.(value & opt Config_parser.(some (ignore_c "interface")) None doc)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Annoyingly this collides with the mirage unix argument --interface /o\

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I'm not sure what to do...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we can figure out a way to rename the unix interface option

@reynir reynir merged commit 5726ca2 into main Nov 6, 2024
2 of 3 checks passed
@reynir reynir deleted the options branch November 6, 2024 19:22
@hannesm
Copy link
Contributor Author

hannesm commented Nov 6, 2024

fails in CI, I'll push my changes from my laptop in the morning (I did some changes in lib that I forgot to push)

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

Successfully merging this pull request may close these issues.

2 participants