CLI: separate "global" and "action" CLI argument parsing. #3002
Unanswered
jcollie
asked this question in
Ideas and Issue Triage
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As I found out in #3000 it's difficult to have a CLI action that uses both "global" CLI configuration flags and action-specific CLI configuration flags. This is because the argument parser looks at every configuration flag and tries to parse it into whatever "config" struct it has been given.
My proposal is to split argument parsing into "pre" and "post" verb sections. "Global" config parsing (i.e.
src/config/Config.zig
) would only use CLI arguments that appear before any action verb (e.g.-e
,+list-fonts
, etc.) and would ignore any that appear after any action verb. "Action" config parsing (e.g.src/cli/list_fonts.zig
) would only use those that appeared after, ignoring those before.Beta Was this translation helpful? Give feedback.
All reactions