From 0296cd590e4c0a21f75b7ec7b420d849c7e9588e Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 6 Mar 2021 23:02:06 +0300 Subject: :arrow_up: xflags --- xtask/Cargo.toml | 2 +- xtask/src/flags.rs | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'xtask') diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index b17dde598..e084f0df6 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -15,5 +15,5 @@ ungrammar = "=1.11" walkdir = "2.3.1" write-json = "0.1.0" xshell = "0.1" -xflags = "0.1.2" +xflags = "0.2.1" # Avoid adding more dependencies to this crate diff --git a/xtask/src/flags.rs b/xtask/src/flags.rs index 56eda5b1e..b39d937ca 100644 --- a/xtask/src/flags.rs +++ b/xtask/src/flags.rs @@ -2,7 +2,9 @@ use crate::install::{ClientOpt, Malloc, ServerOpt}; -xflags::args_parser! { +xflags::xflags! { + src "./src/flags.rs" + /// Run custom build command. cmd xtask { default cmd help { @@ -55,7 +57,7 @@ xflags::args_parser! { // generated start // The following code is generated by `xflags` macro. -// Run `env XFLAGS_DUMP= cargo build` to regenerate. +// Run `env UPDATE_XFLAGS=1 cargo build` to regenerate. #[derive(Debug)] pub struct Xtask { pub subcommand: XtaskCmd, @@ -96,13 +98,13 @@ pub struct Codegen { } #[derive(Debug)] -pub struct Lint {} +pub struct Lint; #[derive(Debug)] -pub struct FuzzTests {} +pub struct FuzzTests; #[derive(Debug)] -pub struct PreCache {} +pub struct PreCache; #[derive(Debug)] pub struct Release { @@ -131,11 +133,10 @@ pub struct Bb { } impl Xtask { - pub const HELP: &'static str = Self::_HELP; + pub const HELP: &'static str = Self::HELP_; pub fn from_env() -> xflags::Result { - let mut p = xflags::rt::Parser::new_from_env(); - Self::_parse(&mut p) + Self::from_env_() } } // generated end -- cgit v1.2.3