summaryrefslogtreecommitdiffstats
path: root/src/cli.rs
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2021-04-17 14:37:46 +0200
committerMatthias Beyer <mail@beyermatthias.de>2021-04-17 14:59:43 +0200
commit056a0728c775e37460ed00791ad503e03a88f3d6 (patch)
treea7bcc714aa39dd4bfb6e64d4c9e7689487c2da9f /src/cli.rs
Initial import
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src/cli.rs')
-rw-r--r--src/cli.rs36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/cli.rs b/src/cli.rs
new file mode 100644
index 0000000..9098cfe
--- /dev/null
+++ b/src/cli.rs
@@ -0,0 +1,36 @@
+use clap::App;
+use clap::Arg;
+use clap::crate_authors;
+use clap::crate_version;
+
+pub fn app<'a>() -> App<'a, 'a> {
+
+ App::new("fss")
+ .author(crate_authors!())
+ .version(crate_version!())
+ .about("Filesystemsearch")
+
+ .subcommand(App::new("index")
+ .version(crate_version!())
+ .about("Index a file")
+ .arg(Arg::with_name("file")
+ .required(true)
+ .multiple(true)
+ .value_name("FILE")
+ .help("Index these files")
+ )
+ )
+
+ .subcommand(App::new("search")
+ .version(crate_version!())
+ .about("Search for a file")
+ .arg(Arg::with_name("term")
+ .required(true)
+ .multiple(true)
+ .value_name("TERM")
+ .help("Search with these terms")
+ )
+ )
+}
+
+