Skip to content

Commit

Permalink
Add app.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
tsoutsman committed Aug 26, 2021
1 parent a181cd7 commit 2fc7395
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ repository = "https://github.com/tsoutsman/lurien"
license = "MIT OR Apache-2.0"

[dependencies]
clap = "2"
clap = "3.0.0-beta.4"
26 changes: 26 additions & 0 deletions src/app.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
use clap::Clap;

#[derive(Clap, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
#[clap(
name = "lurien",
version = "0.1",
author = "Klim Tsoutsman",
rename_all = "kebab"
)]
pub enum App {
Populate(Populate),
Save(Save),
Watch(Watch),
}

/// Apply the markers from a `.lurien` file
#[derive(Clap, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub struct Populate {}

/// Save the markers in the specified directory into a `.lurien` file
#[derive(Clap, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub struct Save {}

/// Watch for changes in the config and adjust the specified `.lurien` file accordingly
#[derive(Clap, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub struct Watch {}
6 changes: 5 additions & 1 deletion src/bin/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
use lurien::app::App;

use clap::Clap;

fn main() {
println!("Hello, world!");
let opt = App::parse();
}
11 changes: 11 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//! A tool to help manage config files on multiple devices.
#![warn(
rust_2018_idioms,
rust_2021_compatibility,
future_incompatible,
missing_debug_implementations,
missing_copy_implementations,
rustdoc::broken_intra_doc_links
)]

pub mod app;

0 comments on commit 2fc7395

Please sign in to comment.