-
Notifications
You must be signed in to change notification settings - Fork 5
feat/mcl/jcli #235
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
base: main
Are you sure you want to change the base?
feat/mcl/jcli #235
Conversation
monyarm
commented
Apr 3, 2025
- feat(mcl): Add commandline argument support
- feat(mcl/utils/log): Implement errorAndExit function
- feat(mcl/utils/process): Add support to execute function, for supplying redirect; Improve execute function argument escaping, to not escape globs
- feat(mcl/config): Implement mcl config command
- refactor(mcl/dub): Remove deprecated dflags for improved build configuration
- fix(ci_matrix): Initialize params directly in ci_matrix function
- fix(utils/cachix): Modify getCachixDeploymenApiUrl definition, to allow compilation with newer d compiler versions.
- feat(mcl/main): Integrate argparse for command-line argument parsing and enhance command handling
- feat(commands/get_fstab): Enhance get_fstab command with argparse integration and structured argument handling
- feat(commands/deploy_spec): Enhance deploy_spec command with argparse integration and structured argument handling
- feat(commands/host_info): Enhance host_info command with argparse integration and structured argument handling
- feat(commands/config): Enhance config command with argparse integration and structured argument handling
- feat(commands/machine): Enhance machine command with argparse integration and structured argument handling
- feat(commands): Enhance ci/matrix commands with argparse integration and structured argument handling where applicable
662b512
to
a999476
Compare
…and enhance command handling
…egration and structured argument handling
… integration and structured argument handling
…egration and structured argument handling
…on and structured argument handling
…tion and structured argument handling
…and structured argument handling where applicable
… for host info retrieval
Thanks for your Pull Request! This comment will be updated automatically with the status of each package. |
const char[] genSubCommandArgs = | ||
"@SubCommands\n"~ | ||
"SumType!("~ | ||
"get_fstab_args,"~ | ||
"deploy_spec_args,"~ | ||
"host_info_args,"~ | ||
"config_args,"~ | ||
"machine_args,"~ | ||
"ci_matrix_args,"~ | ||
"ci_args,"~ | ||
"print_table_args,"~ | ||
"shard_matrix_args,"~ | ||
"Default!unknown_command_args"~ | ||
") cmd;"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be done in a similar fashion to the following genSubCommandMatch
template?
LogLevel logLevel = LogLevel.info; | ||
args.getopt("log-level", &logLevel); | ||
@(Command(" ").Description(" ")) | ||
struct unknown_command_args {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer capitalized names (PascalCase
, to be exact) for struct
s. Applies to the rest of the _args
struct
s too.
export void print_table(string[] args) | ||
@(Command("print-table", "print_table").Description("Print a table of the cache status of each package")) | ||
struct print_table_args | ||
{ | ||
} | ||
|
||
export int print_table(print_table_args args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we instead try supporting argument-less commands by providing an aptly argument-less function returning void
, with genSubCommandArgs
being updated to dynamically check whether or not each sub-command handler function has arguments/return value at all before taking them into account?
This also applies to all _args
struct
s annotated with @(Command(" ").Description(" "))
.