forked from eclipse-iceoryx/iceoryx2
-
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.
[eclipse-iceoryx#98] Define entrypoint cli using clap
- Loading branch information
Showing
4 changed files
with
42 additions
and
5 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,24 @@ | ||
use clap::Parser; | ||
|
||
#[derive(Parser, Debug)] | ||
#[command( | ||
name = "iox2", | ||
about = "The command-line interface to iceoryx2", | ||
long_about = None, | ||
version = env!("CARGO_PKG_VERSION"), | ||
disable_help_subcommand = true, | ||
arg_required_else_help = true, | ||
help_template = help_template(), | ||
)] | ||
pub struct Cli { | ||
#[arg(short, long, help = "List all installed commands")] | ||
pub list: bool, | ||
} | ||
|
||
fn help_template() -> &'static str { | ||
"\ | ||
USAGE: iox2 [OPTIONS] <COMMAND>\n\n\ | ||
OPTIONS:\n{options}\n\n\ | ||
COMMANDS:\n{subcommands}\n\ | ||
\u{00A0}\u{00A0}... See all installed commands with --list" | ||
} |
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