Skip to content

Commit

Permalink
Merge pull request #3730 from mulkieran/stratisd-tools-helptext
Browse files Browse the repository at this point in the history
Add some additional help documentation to stratisd-tools
  • Loading branch information
mulkieran authored Dec 6, 2024
2 parents 11e3675 + da53ae3 commit 908402a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/bin/stratisd-tools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ use env_logger::Builder;

use crate::tools::cmds;

use stratisd::stratis::VERSION;

fn basename(path: &str) -> Option<&Path> {
Path::new(path).file_name().map(Path::new)
}
Expand Down Expand Up @@ -42,6 +44,8 @@ fn main() {
.unwrap_or(false)
{
let command = Command::new(executable_name)
.version(VERSION)
.about("Top-level command used to invoke one of a set of stratisd tools")
.arg(
Arg::new("executable")
.required(true)
Expand Down
4 changes: 4 additions & 0 deletions src/bin/tools/cmds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ use clap::{Arg, ArgAction, Command};

use crate::tools::dump_metadata;

use stratisd::stratis::VERSION;

pub trait ToolCommand<'a> {
fn name(&self) -> &'a str;
fn run(&self, command_line_args: Vec<String>) -> Result<(), String>;
Expand All @@ -18,6 +20,8 @@ struct StratisDumpMetadata;
impl StratisDumpMetadata {
fn cmd() -> Command {
Command::new("stratis-dumpmetadata")
.version(VERSION)
.about("Reads Stratis metadata from a Stratis device and displays it")
.next_line_help(true)
.arg(
Arg::new("dev")
Expand Down

0 comments on commit 908402a

Please sign in to comment.