⬆️ xflags

This commit is contained in:
Aleksey Kladov 2021-03-06 23:02:06 +03:00
parent 71b8fb7c57
commit 0296cd590e
5 changed files with 23 additions and 21 deletions

View file

@ -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<Self> {
let mut p = xflags::rt::Parser::new_from_env();
Self::_parse(&mut p)
Self::from_env_()
}
}
// generated end