feat: define command arguments to parse
This commit is contained in:
parent
93158ea0a0
commit
db0d599577
2 changed files with 15 additions and 1 deletions
|
@ -5,7 +5,7 @@ edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
#bytes = "1.9"
|
#bytes = "1.9"
|
||||||
#clap = { version = "4.5", features = ["cargo", "derive"] }
|
clap = { version = "4.5", features = ["cargo", "derive"] }
|
||||||
color-eyre = "0.6"
|
color-eyre = "0.6"
|
||||||
#derive_more = { version = "1.0", features = [
|
#derive_more = { version = "1.0", features = [
|
||||||
# "as_ref",
|
# "as_ref",
|
||||||
|
|
14
src/lib.rs
14
src/lib.rs
|
@ -1,8 +1,22 @@
|
||||||
//
|
//
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
|
use clap::Parser;
|
||||||
use kxio::{fs::FileSystem, net::Net};
|
use kxio::{fs::FileSystem, net::Net};
|
||||||
|
|
||||||
|
#[derive(Parser, Debug)]
|
||||||
|
#[clap(version = clap::crate_version!(), author = clap::crate_authors!(), about = clap::crate_description!())]
|
||||||
|
struct Commands {
|
||||||
|
#[clap(subcommand)]
|
||||||
|
command: Command,
|
||||||
|
}
|
||||||
|
#[derive(Parser, Debug)]
|
||||||
|
enum Command {
|
||||||
|
Init,
|
||||||
|
Check,
|
||||||
|
Import,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct Ctx {
|
pub struct Ctx {
|
||||||
pub fs: FileSystem,
|
pub fs: FileSystem,
|
||||||
|
|
Loading…
Reference in a new issue