Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
cli: Display rad-web in rad --help
Sebastian Martinez committed 2 years ago
commit 921f9f2d761a3f88883b60894ce623f5efaaaaae
parent 1af505c5c3d5b3924fd1867503bc6d743642b022
2 files changed +13 -1
modified radicle-cli/src/commands/help.rs
@@ -1,4 +1,6 @@
use std::ffi::OsString;
+
use std::process::Command;
+
use std::str;

use crate::terminal as term;
use crate::terminal::args::{Args, Error, Help};
@@ -81,6 +83,16 @@ pub fn run(_options: Options, ctx: impl term::Context) -> anyhow::Result<()> {
            term::format::dim(help.description)
        );
    }
+
    // Obtain the rad-web help.
+
    if let Ok(output) = Command::new("rad-web").arg("--help").output() {
+
        if let Some(description) = str::from_utf8(&output.stdout)?.lines().nth(1) {
+
            term::info!(
+
                "\t{} {}",
+
                term::format::bold(format!("{:-12}", "web")),
+
                term::format::dim(description)
+
            );
+
        }
+
    }
    term::blank();
    term::print("See `rad <command> --help` to learn about a specific command.");
    term::blank();
modified radicle-httpd/src/commands/web.rs
@@ -15,7 +15,7 @@ use radicle_cli::terminal::args::{Args, Error, Help};

pub const HELP: Help = Help {
    name: "web",
-
    description: "Start HTTP API server and connect the web explorer to it",
+
    description: "Run the HTTP daemon and connect the web explorer to it",
    version: env!("CARGO_PKG_VERSION"),
    usage: r#"
Usage