Better missing self update feature (#8337)

This commit is contained in:
konsti 2024-10-18 19:38:34 +02:00 committed by GitHub
parent d53d580221
commit e26eed10e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 158 additions and 18 deletions

View file

@ -408,7 +408,6 @@ pub enum Commands {
Cache(CacheNamespace),
/// Manage the uv executable.
#[command(name = "self")]
#[cfg(feature = "self-update")]
Self_(SelfNamespace),
/// Clear the cache, removing all entries or those linked to specific packages.
#[command(hide = true)]
@ -449,21 +448,18 @@ pub struct HelpArgs {
}
#[derive(Args)]
#[cfg(feature = "self-update")]
pub struct SelfNamespace {
#[command(subcommand)]
pub command: SelfCommand,
}
#[derive(Subcommand)]
#[cfg(feature = "self-update")]
pub enum SelfCommand {
/// Update uv.
Update(SelfUpdateArgs),
}
#[derive(Args, Debug)]
#[cfg(feature = "self-update")]
pub struct SelfUpdateArgs {
/// Update to the specified version. If not provided, uv will update to the latest version.
pub target_version: Option<String>,