-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update documentation and changelog (#236)
- Loading branch information
1 parent
6bd1a69
commit 8830771
Showing
3 changed files
with
309 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
use structopt::StructOpt; | ||
|
||
#[derive(StructOpt, Debug, PartialEq)] | ||
#[structopt(name = "a")] | ||
pub struct Opt { | ||
#[structopt(long, short)] | ||
number: u32, | ||
#[structopt(skip)] | ||
k: Kind, | ||
#[structopt(skip)] | ||
v: Vec<u32>, | ||
} | ||
|
||
#[derive(Debug, PartialEq)] | ||
#[allow(unused)] | ||
enum Kind { | ||
A, | ||
B, | ||
} | ||
|
||
impl Default for Kind { | ||
fn default() -> Self { | ||
return Kind::B; | ||
} | ||
} | ||
|
||
fn main() { | ||
assert_eq!( | ||
Opt::from_iter(&["test", "-n", "10"]), | ||
Opt { | ||
number: 10, | ||
k: Kind::B, | ||
v: vec![], | ||
} | ||
); | ||
} |
Oops, something went wrong.