diff options
author | Emil Gardström <[email protected]> | 2020-10-16 23:35:06 +0100 |
---|---|---|
committer | Emil Gardström <[email protected]> | 2020-10-17 09:28:12 +0100 |
commit | d0bb051ef7a2cfb4cc1d26e2cf981c4e345269e8 (patch) | |
tree | 4ecae58271e5680cced937b4716700c6e86505ba /xtask/src/main.rs | |
parent | 59483c217662fc5d89ef9da1cb93760e14a48418 (diff) |
allow xtask install --client-code[=CLIENT] to specify client
Diffstat (limited to 'xtask/src/main.rs')
-rw-r--r-- | xtask/src/main.rs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 97e5dcd4e..62124041d 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs | |||
@@ -16,7 +16,7 @@ use xshell::pushd; | |||
16 | use xtask::{ | 16 | use xtask::{ |
17 | codegen::{self, Mode}, | 17 | codegen::{self, Mode}, |
18 | dist::DistCmd, | 18 | dist::DistCmd, |
19 | install::{ClientOpt, InstallCmd, Malloc, ServerOpt}, | 19 | install::{InstallCmd, Malloc, ServerOpt}, |
20 | metrics::MetricsCmd, | 20 | metrics::MetricsCmd, |
21 | pre_cache::PreCacheCmd, | 21 | pre_cache::PreCacheCmd, |
22 | pre_commit, project_root, | 22 | pre_commit, project_root, |
@@ -46,10 +46,11 @@ USAGE: | |||
46 | cargo xtask install [FLAGS] | 46 | cargo xtask install [FLAGS] |
47 | 47 | ||
48 | FLAGS: | 48 | FLAGS: |
49 | --client-code Install only VS Code plugin | 49 | --client-code[=CLIENT] Install only VS Code plugin. |
50 | --server Install only the language server | 50 | CLIENT is one of 'code', 'code-insiders', 'codium', or 'code-oss' |
51 | --mimalloc Use mimalloc for server | 51 | --server Install only the language server |
52 | -h, --help Prints help information | 52 | --mimalloc Use mimalloc for server |
53 | -h, --help Prints help information | ||
53 | " | 54 | " |
54 | ); | 55 | ); |
55 | return Ok(()); | 56 | return Ok(()); |
@@ -67,10 +68,12 @@ FLAGS: | |||
67 | let malloc = | 68 | let malloc = |
68 | if args.contains("--mimalloc") { Malloc::Mimalloc } else { Malloc::System }; | 69 | if args.contains("--mimalloc") { Malloc::Mimalloc } else { Malloc::System }; |
69 | 70 | ||
71 | let client_opt = args.opt_value_from_str("--client-code")?; | ||
72 | |||
70 | args.finish()?; | 73 | args.finish()?; |
71 | 74 | ||
72 | InstallCmd { | 75 | InstallCmd { |
73 | client: if server { None } else { Some(ClientOpt::VsCode) }, | 76 | client: if server { None } else { Some(client_opt.unwrap_or_default()) }, |
74 | server: if client_code { None } else { Some(ServerOpt { malloc }) }, | 77 | server: if client_code { None } else { Some(ServerOpt { malloc }) }, |
75 | } | 78 | } |
76 | .run() | 79 | .run() |