diff options
author | Jesse Luehrs <doy@tozt.net> | 2022-03-04 22:08:42 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2022-03-04 22:08:42 -0500 |
commit | e217b3ee27f75ffc2b27753bc88cca8a9342307b (patch) | |
tree | b4c898324df13e2e94914b9a92171f47879e9a84 /src | |
parent | a47ef825137cdb9a66ae06dbb39ee6bbffd588f2 (diff) | |
download | nbsh-e217b3ee27f75ffc2b27753bc88cca8a9342307b.tar.gz nbsh-e217b3ee27f75ffc2b27753bc88cca8a9342307b.zip |
move to clap 3
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/main.rs b/src/main.rs index b3e2fd5..ca175d0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -26,13 +26,15 @@ mod shell; use prelude::*; -#[derive(structopt::StructOpt)] -#[structopt(about = "NoteBook SHell")] +use clap::Parser as _; + +#[derive(clap::Parser)] +#[clap(about = "NoteBook SHell")] struct Opt { - #[structopt(short = "c")] + #[clap(short = 'c')] command: Option<String>, - #[structopt(long)] + #[clap(long)] status_fd: Option<std::os::unix::io::RawFd>, } @@ -53,9 +55,8 @@ async fn async_main(opt: Opt) -> Result<i32> { shell::main().await } -#[paw::main] -fn main(opt: Opt) { - match async_main(opt) { +fn main() { + match async_main(Opt::parse()) { Ok(code) => { std::process::exit(code); } |