-
-
Notifications
You must be signed in to change notification settings - Fork 90
Closed
Labels
✨ enhancementNew feature or requestNew feature or request
Description
@epage suggested this on Reddit:
Instead of free-form attributes, what if attributes were const-expressions that evaluated to a value that gets stored? It seems like those could be instropected like anything else in facet.
use facet_args::prelude::*;
#[derive(Facet)]
struct Args {
#[facet(Positional)]
path: String,
#[facet(Named, Short('v'))]
verbose: bool,
#[facet(Named, Short('j'))]
concurrency: usize,
}
Maybe you could event do a hack like clap's where Name = Value gets treated as Name(Value)
use facet_args::prelude::*;
#[derive(Facet)]
struct Args {
#[facet(Positional)]
path: String,
#[facet(Named, Short = 'v')]
verbose: bool,
#[facet(Named, Short = 'j')]
concurrency: usize,
}I'm not sure exactly how this would work, but I'm willing to try.
Metadata
Metadata
Assignees
Labels
✨ enhancementNew feature or requestNew feature or request