mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-28 20:43:31 +01:00
add cli update-extensions prototype
This commit is contained in:
@@ -60,6 +60,7 @@ pub fn try_parse_legacy(
|
||||
|
||||
// Now translate them to subcommands.
|
||||
// --list-extensions -> ext list
|
||||
// --update-extensions -> update
|
||||
// --install-extension=id -> ext install <id>
|
||||
// --uninstall-extension=id -> ext uninstall <id>
|
||||
// --status -> status
|
||||
@@ -87,6 +88,14 @@ pub fn try_parse_legacy(
|
||||
})),
|
||||
..Default::default()
|
||||
})
|
||||
} else if let Some(_exts) = args.remove("update-extensions") {
|
||||
Some(CliCore {
|
||||
subcommand: Some(Commands::Extension(ExtensionArgs {
|
||||
subcommand: ExtensionSubcommand::Update,
|
||||
desktop_code_options,
|
||||
})),
|
||||
..Default::default()
|
||||
})
|
||||
} else if let Some(exts) = args.remove("uninstall-extension") {
|
||||
Some(CliCore {
|
||||
subcommand: Some(Commands::Extension(ExtensionArgs {
|
||||
|
||||
@@ -254,6 +254,8 @@ pub enum ExtensionSubcommand {
|
||||
Install(InstallExtensionArgs),
|
||||
/// Uninstall an extension.
|
||||
Uninstall(UninstallExtensionArgs),
|
||||
/// Update the marketplace-installed extensions.
|
||||
Update,
|
||||
}
|
||||
|
||||
impl ExtensionSubcommand {
|
||||
@@ -284,6 +286,9 @@ impl ExtensionSubcommand {
|
||||
target.push(format!("--uninstall-extension={}", id));
|
||||
}
|
||||
}
|
||||
ExtensionSubcommand::Update => {
|
||||
target.push("--update-extensions".to_string());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@ pub struct CodeServerArgs {
|
||||
// extension management
|
||||
pub install_extensions: Vec<String>,
|
||||
pub uninstall_extensions: Vec<String>,
|
||||
pub update_extensions: bool,
|
||||
pub list_extensions: bool,
|
||||
pub show_versions: bool,
|
||||
pub category: Option<String>,
|
||||
@@ -129,6 +130,9 @@ impl CodeServerArgs {
|
||||
for extension in &self.uninstall_extensions {
|
||||
args.push(format!("--uninstall-extension={}", extension));
|
||||
}
|
||||
if self.update_extensions {
|
||||
args.push(String::from("--update-extensions"));
|
||||
}
|
||||
if self.list_extensions {
|
||||
args.push(String::from("--list-extensions"));
|
||||
if self.show_versions {
|
||||
|
||||
Reference in New Issue
Block a user