-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor configuration; Remove db-path from command line arguments
- Loading branch information
Showing
11 changed files
with
154 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use clap::{Parser, Subcommand}; | ||
|
||
#[derive(Subcommand, Clone, Debug)] | ||
pub enum Command { | ||
#[command(about = "Add a strike", alias = "s")] | ||
Strike { name: String }, | ||
#[command(about = "List all strikes")] | ||
Ls, | ||
#[command(about = "Clear strikes", alias = "c")] | ||
Clear, | ||
} | ||
|
||
#[derive(Clone, Debug, Parser)] | ||
#[command( | ||
name = "Strikes CLI", | ||
version = "0.1.0", | ||
about = "Track and assign strikes", | ||
long_about = "Simple CLI tool to track and assign strikes" | ||
)] | ||
pub struct Cli { | ||
#[arg( | ||
short, | ||
long, | ||
help = "Specify the path to the configuration file where the strikes are stored" | ||
)] | ||
pub config_path: Option<std::path::PathBuf>, | ||
|
||
#[command(subcommand)] | ||
pub command: Option<Command>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
pub mod client; | ||
pub mod local_client; | ||
pub mod remote_client; | ||
pub mod client; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
pub mod configuration; | ||
pub mod cli; | ||
pub mod clients; | ||
pub mod configuration; | ||
pub mod output; | ||
pub mod tarnished; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,3 @@ impl Tarnished { | |
.collect() | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.