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:
Joe Bellus 2021-11-13 06:48:39 +00:00
commit 4e0ba0efc3
2 changed files with 13 additions and 0 deletions

View File

@ -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(

View File

@ -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.