-
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.
Move thewithn CLI definition to a library.
- Loading branch information
Showing
4 changed files
with
54 additions
and
47 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
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,40 @@ | ||
/// Command-line definition for thebacknd agent binary (called thewithn). | ||
use clap::{Parser, Subcommand}; | ||
|
||
#[derive(Parser)] | ||
#[command(name = "thewithn")] | ||
#[command(about = "A program that behaves differently based on the symlink name or subcommands")] | ||
pub struct Cli { | ||
#[command(subcommand)] | ||
pub command: Option<Commands>, | ||
} | ||
|
||
#[derive(Subcommand)] | ||
pub enum Commands { | ||
CurrentSystem(CurrentSystemCmd), | ||
DesiredSystem(DesiredSystemCmd), | ||
DestroySystem(DestroySystemCmd), | ||
UpdateSystem(UpdateSystemCmd), | ||
} | ||
|
||
#[derive(Parser)] | ||
pub struct CurrentSystemCmd { | ||
} | ||
|
||
#[derive(Parser)] | ||
pub struct DesiredSystemCmd { | ||
/// Provide a custom message | ||
#[arg(short, long, default_value = "Called as 'desired-system'.")] | ||
pub message: String, | ||
} | ||
|
||
#[derive(Parser)] | ||
pub struct DestroySystemCmd { | ||
/// Print extra details | ||
#[arg(short, long)] | ||
pub details: bool, | ||
} | ||
|
||
#[derive(Parser)] | ||
pub struct UpdateSystemCmd { | ||
} |
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 @@ | ||
pub mod cli; |
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 +1,2 @@ | ||
pub mod agent; | ||
pub mod client; |