Merge branch '1-root-level-description' into 'v0.1.1'
Added App::long_desc(self) which sets the root level description See merge request arkham/arkham!1
This commit is contained in:
commit
4e0ba0efc3
|
@ -4,6 +4,7 @@ fn main() {
|
|||
let _ = App::new()
|
||||
.name("Fibonacci App")
|
||||
.version("1.0")
|
||||
.long_desc("This app can be used to calculate fibonacci numbers")
|
||||
.command(
|
||||
Command::new("fib")
|
||||
.opt(
|
||||
|
|
12
src/app.rs
12
src/app.rs
|
@ -140,6 +140,18 @@ impl App {
|
|||
self
|
||||
}
|
||||
|
||||
/// Sets the longe description for the bare app. This will be displayed in the help content
|
||||
/// when no additional subcommands are given.
|
||||
/// Example:
|
||||
/// ```rust
|
||||
/// use arkham::{App, Command, Context};
|
||||
/// App::new().long_desc("This app does all the things");
|
||||
/// ```
|
||||
pub fn long_desc(mut self, desc: &str) -> Self {
|
||||
self.root.long_desc = Some(desc.to_string());
|
||||
self
|
||||
}
|
||||
|
||||
/// Execute the app and any specified handlers based on the passed arguemnts. This function is
|
||||
/// mostly used for testing or any situation where you need to pass arbitrary arguments instead
|
||||
/// of using the ones passed to the application.
|
||||
|
|
Loading…
Reference in New Issue