Commit 9f15159b authored by Moul's avatar Moul Committed by Éloïs

[ref] core: improve command line interface

parent 12aea3cb
......@@ -37,25 +37,25 @@ pub enum DbExSubCommand {
name = "distance",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
/// durs databases explorer (distances datas)
/// Web of Trust distances explorer
DistanceOpt(DistanceOpt),
#[structopt(
name = "members",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
/// durs databases explorer (members datas)
/// Members explorer
MembersOpt(MembersOpt),
#[structopt(
name = "member",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
/// durs databases explorer (member datas)
/// Member explorer
MemberOpt(MemberOpt),
#[structopt(
name = "balance",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
/// durs databases explorer (balances datas)
/// Pubkeys’ balances explorer
BalanceOpt(BalanceOpt),
}
......
......@@ -37,11 +37,11 @@ use log::Level;
/// Rust implementation of Duniter
pub struct DursOpt {
#[structopt(short = "p", long = "profile")]
/// Set a custom user datas folder
/// Set a custom user data folder
profile_name: Option<String>,
#[structopt(short = "l", long = "logs", raw(next_line_help = "true"))]
/// Set the level of logs verbosity. (Default is INFO).
/// Possible values : [OFF, ERROR, WARN, INFO, DEBUG, TRACE]
/// Set log level. (Defaults to INFO).
/// Available levels: [OFF, ERROR, WARN, INFO, DEBUG, TRACE]
logs_level: Option<Level>,
#[structopt(subcommand)]
/// CoreSubCommand
......@@ -52,33 +52,33 @@ pub struct DursOpt {
/// Core cli subcommands
pub enum CoreSubCommand {
#[structopt(name = "enable")]
/// Enable some module
/// Enable a module
EnableOpt(EnableOpt),
#[structopt(name = "disable")]
/// Disable some module
/// Disable a module
DisableOpt(DisableOpt),
#[structopt(name = "modules")]
/// list modules
/// List available modules
ListModulesOpt(ListModulesOpt),
#[structopt(name = "start")]
/// start durs server
/// Start node
StartOpt(StartOpt),
#[structopt(name = "sync")]
/// synchronization
/// Synchronize
SyncOpt(SyncOpt),
/// reset data or conf or all
/// Reset data or conf or all
#[structopt(
name = "reset",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
ResetOpt(ResetOpt),
/// durs databases explorer
/// Database explorer
#[structopt(
name = "dbex",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
DbExOpt(DbExOpt),
/// keys operations
/// Keys operations
#[structopt(
name = "keys",
author = "inso <inso@tuta.io>",
......
......@@ -19,9 +19,9 @@ use crate::cli::InvalidInput;
use std::str::FromStr;
#[derive(StructOpt, Debug, Copy, Clone)]
/// start durs server
/// Reset data or configuration
pub struct ResetOpt {
/// choose type datas to reset
/// Kind of data to be reseted: data, conf, all
pub reset_type: ResetType,
}
......@@ -44,7 +44,7 @@ impl FromStr for ResetType {
"data" => Ok(ResetType::Datas),
"conf" => Ok(ResetType::Conf),
"all" => Ok(ResetType::All),
_ => Err(InvalidInput("Values accepted are : data, conf, all.")),
_ => Err(InvalidInput("Kind of data to be reseted: data, conf, all.")),
}
}
}
......@@ -89,7 +89,7 @@ pub fn dbex_tx<DC: DuniterConf>(profile: &str, conf: &DC, _csv: bool, query: &DB
{
pubkey
} else {
println!("This address doesn't exist !");
println!("This address doesn't exist!");
return;
};
let address = UTXOConditionsGroup::Single(TransactionOutputCondition::Sig(pubkey));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment