diff options
Diffstat (limited to 'xtask/src/main.rs')
-rw-r--r-- | xtask/src/main.rs | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/xtask/src/main.rs b/xtask/src/main.rs index e419db7a7..ca27b6cec 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs | |||
@@ -28,11 +28,7 @@ use std::{ | |||
28 | use walkdir::{DirEntry, WalkDir}; | 28 | use walkdir::{DirEntry, WalkDir}; |
29 | use xshell::{cmd, cp, pushd, pushenv}; | 29 | use xshell::{cmd, cp, pushd, pushenv}; |
30 | 30 | ||
31 | use crate::{ | 31 | use crate::{codegen::Mode, dist::DistCmd}; |
32 | codegen::Mode, | ||
33 | dist::DistCmd, | ||
34 | install::{InstallCmd, Malloc, ServerOpt}, | ||
35 | }; | ||
36 | 32 | ||
37 | fn main() -> Result<()> { | 33 | fn main() -> Result<()> { |
38 | let _d = pushd(project_root())?; | 34 | let _d = pushd(project_root())?; |
@@ -43,30 +39,9 @@ fn main() -> Result<()> { | |||
43 | println!("{}", flags::Xtask::HELP); | 39 | println!("{}", flags::Xtask::HELP); |
44 | return Ok(()); | 40 | return Ok(()); |
45 | } | 41 | } |
46 | flags::XtaskCmd::Install(flags) => { | 42 | flags::XtaskCmd::Install(cmd) => { |
47 | if flags.server && flags.client { | 43 | cmd.validate()?; |
48 | eprintln!( | 44 | cmd.run() |
49 | "error: The argument `--server` cannot be used with `--client`\n\n\ | ||
50 | For more information try --help" | ||
51 | ); | ||
52 | return Ok(()); | ||
53 | } | ||
54 | |||
55 | let malloc = if flags.mimalloc { | ||
56 | Malloc::Mimalloc | ||
57 | } else if flags.jemalloc { | ||
58 | Malloc::Jemalloc | ||
59 | } else { | ||
60 | Malloc::System | ||
61 | }; | ||
62 | |||
63 | let client_bin = flags.code_bin.map(|it| it.parse()).transpose()?; | ||
64 | |||
65 | InstallCmd { | ||
66 | client: if flags.server { None } else { client_bin }, | ||
67 | server: if flags.client { None } else { Some(ServerOpt { malloc }) }, | ||
68 | } | ||
69 | .run() | ||
70 | } | 45 | } |
71 | flags::XtaskCmd::Codegen(cmd) => cmd.run(), | 46 | flags::XtaskCmd::Codegen(cmd) => cmd.run(), |
72 | flags::XtaskCmd::Lint(_) => run_clippy(), | 47 | flags::XtaskCmd::Lint(_) => run_clippy(), |