summaryrefslogtreecommitdiffstats
path: root/cli/src/cli.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/src/cli.rs')
-rw-r--r--cli/src/cli.rs59
1 files changed, 59 insertions, 0 deletions
diff --git a/cli/src/cli.rs b/cli/src/cli.rs
new file mode 100644
index 0000000..3f74128
--- /dev/null
+++ b/cli/src/cli.rs
@@ -0,0 +1,59 @@
+use clap::crate_authors;
+use clap::crate_version;
+use clap::App;
+use clap::Arg;
+
+pub fn app<'a>() -> App<'a> {
+ App::new("distrox")
+ .author(crate_authors!())
+ .version(crate_version!())
+ .about("Distributed social network")
+
+ .subcommand(App::new("profile")
+ .author(crate_authors!())
+ .version(crate_version!())
+ .about("Profile actions")
+
+ .subcommand(App::new("create")
+ .author(crate_authors!())
+ .version(crate_version!())
+ .about("Create profile")
+
+ .arg(Arg::new("name")
+ .long("name")
+ .required(true)
+ .takes_value(true)
+ .value_name("NAME")
+ .about("Name of the profile")
+ )
+ )
+
+ .subcommand(App::new("serve")
+ .author(crate_authors!())
+ .version(crate_version!())
+ .about("Just serve the profile")
+
+ .arg(Arg::new("name")
+ .long("name")
+ .required(true)
+ .takes_value(true)
+ .value_name("NAME")
+ .about("Name of the profile")
+ )
+
+ .arg(Arg::new("connect")
+ .long("connect")
+ .required(false)
+ .takes_value(true)
+ .value_name("MULTIADDR")
+ .about("Connect to MULTIADDR as well")
+ )
+ )
+ )
+
+ .subcommand(App::new("gui")
+ .author(crate_authors!())
+ .version(crate_version!())
+ .about("Start the distrox gui")
+ )
+}