-
Notifications
You must be signed in to change notification settings - Fork 372
fix(3197): fix youki version command Part of Enhancing Compatibility with runc #3200
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?
Conversation
…with runc Signed-off-by: tommady <[email protected]>
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.
Pull Request Overview
This PR fixes the youki version
command to enhance compatibility with runc by updating the version output format and command-line interface behavior. The changes ensure that youki -v
or youki --version
produces output in a Moby-compatible format.
- Modified CLI argument parsing to handle version flag separately instead of using a macro
- Updated version output format to match Moby/runc compatibility requirements
- Changed subcommand handling to be optional and display help when no subcommand is provided
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
crates/youki/src/main.rs | Updated CLI parsing to add explicit version flag handling and made subcommands optional |
crates/youki/src/commands/info.rs | Modified version output format to be Moby-compatible |
@@ -54,7 +38,11 @@ struct Opts { | |||
youki_extend: YoukiExtendOpts, | |||
|
|||
#[clap(subcommand)] | |||
subcmd: SubCommand, | |||
subcmd: Option<SubCommand>, |
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.
Making subcmd optional changes the CLI behavior significantly. Consider if this is the intended breaking change, as users who previously relied on subcommands being required may experience different behavior.
subcmd: Option<SubCommand>, | |
subcmd: SubCommand, |
Copilot uses AI. Check for mistakes.
crates/youki/src/main.rs
Outdated
commands::completion::completion(completion, &mut app) | ||
} | ||
None => Opts::command() | ||
.print_help() | ||
.map_err(|e| anyhow::anyhow!(":{e}")), |
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.
The error message format ":{e}" has an unusual leading colon. Consider using a more descriptive format like "Failed to print help: {e}".
.map_err(|e| anyhow::anyhow!(":{e}")), | |
.map_err(|e| anyhow::anyhow!("Failed to print help: {e}")), |
Copilot uses AI. Check for mistakes.
@saku3 May I ask you to review this P? |
Sure! |
Signed-off-by: tommady <[email protected]>
crates/youki/src/main.rs
Outdated
commands::completion::completion(completion, &mut app) | ||
} | ||
None => Opts::command() |
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.
None => Opts::command() | |
None => app.print_help().map_err(|e| anyhow::anyhow!(":{e}")) |
Signed-off-by: tommady <[email protected]>
Thanks. I think this modification looks good. |
Description
Fix Youki version command
This is Part of Enhancing Compatibility with runc
Type of Change
Testing
Related Issues
Fixes #3197
Additional Context