Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
cli: Add `--config` option to `rad self`
cloudhead committed 2 years ago
commit a46c6ff36d580e75c74149e78db81e45131c7eb8
parent d9240c9ae99f2d8e865d3a976e129d7914385af6
2 files changed +14 -0
modified rad.1.adoc
@@ -189,6 +189,12 @@ description and default branch by running:

    $ rad inspect --payload

+
=== Configuration
+

+
Radicle keeps a configuration file at *~/.radicle/config.json* by default. To
+
display its exact location on your system, you can use the *rad self --config*
+
command.
+

=== Environment

Various environment variables are used by *rad*.
modified radicle-cli/src/commands/self.rs
@@ -22,6 +22,7 @@ Options
    --nid                Show your Node ID (NID)
    --did                Show your DID
    --home               Show your Radicle home
+
    --config             Show the location of your configuration file
    --ssh-key            Show your public key in OpenSSH format
    --ssh-fingerprint    Show your public key fingerprint in OpenSSH format
    --help               Show help
@@ -34,6 +35,7 @@ enum Show {
    NodeId,
    Did,
    Home,
+
    Config,
    SshKey,
    SshFingerprint,
    All,
@@ -65,6 +67,9 @@ impl Args for Options {
                Long("home") if show.is_none() => {
                    show = Some(Show::Home);
                }
+
                Long("config") if show.is_none() => {
+
                    show = Some(Show::Config);
+
                }
                Long("ssh-key") if show.is_none() => {
                    show = Some(Show::SshKey);
                }
@@ -103,6 +108,9 @@ pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> {
        Show::Home => {
            term::print(profile.home().display());
        }
+
        Show::Config => {
+
            term::print(profile.home.config().display());
+
        }
        Show::SshKey => {
            term::print(ssh::fmt::key(profile.id()));
        }