cli: Add `--config` option to `rad self`
This commit is contained in:
parent
d9240c9ae9
commit
a46c6ff36d
|
|
@ -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*.
|
||||
|
|
|
|||
|
|
@ -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()));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue