Commit b1c52041 authored by Éloïs's avatar Éloïs

[ref] whole: update structopt 1.2 -> 1.3

parent 30351d42
Pipeline #7233 passed with stages
in 26 minutes and 16 seconds
This diff is collapsed.
......@@ -18,9 +18,9 @@ durs-module = { path = "../../lib/core/module" }
#durs-skeleton = { path = "../../lib/modules/skeleton" }
durs-ws2p = { path = "../../lib/modules/ws2p/ws2p" }
durs-ws2p-v1-legacy = { path = "../../lib/modules/ws2p-v1-legacy" }
log = "0.4.*"
structopt = "0.2.*"
human-panic = "1.0.*"
human-panic = "1.0.1"
log = "0.4.8"
structopt= "0.3.4"
[target.'cfg(unix)'.dependencies]
durs-tui = { path = "../../lib/modules/tui" }
......
......@@ -32,10 +32,7 @@ use std::path::PathBuf;
use structopt::StructOpt;
#[derive(StructOpt, Debug)]
#[structopt(
name = "durs",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
#[structopt(name = "durs", setting(structopt::clap::AppSettings::ColoredHelp))]
/// Dunitrust command line options
pub struct DursCliOpt {
/// Dunitrust subcommand
......@@ -49,7 +46,7 @@ pub struct DursCliOpt {
keypairs_file: Option<PathBuf>,
/// Set log level. (Defaults to INFO).
/// Available levels: [ERROR, WARN, INFO, DEBUG, TRACE]
#[structopt(short = "l", long = "logs", raw(next_line_help = "true"))]
#[structopt(short = "l", long = "logs", next_line_help = true)]
logs_level: Option<Level>,
/// Print logs in standard output
#[structopt(long = "log-stdout")]
......@@ -132,40 +129,34 @@ impl DursCliOpt {
/// Classic Dunitrust nodes subcommand
pub enum DursCliSubCommand {
/// Database explorer
#[structopt(
name = "dbex",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
#[structopt(name = "dbex", setting(structopt::clap::AppSettings::ColoredHelp))]
DbExOpt(DbExOpt),
/// Disable a module
#[structopt(name = "disable")]
#[structopt(name = "disable", setting(structopt::clap::AppSettings::ColoredHelp))]
DisableOpt(DisableOpt),
/// Enable a module
#[structopt(name = "enable")]
#[structopt(name = "enable", setting(structopt::clap::AppSettings::ColoredHelp))]
EnableOpt(EnableOpt),
/// Keys operations
#[structopt(
name = "keys",
author = "inso <inso@tuta.io>",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
setting(structopt::clap::AppSettings::ColoredHelp)
)]
KeysOpt(KeysOpt),
/// List available modules
#[structopt(name = "modules")]
#[structopt(name = "modules", setting(structopt::clap::AppSettings::ColoredHelp))]
ListModulesOpt(ListModulesOpt),
/// Reset data or conf or all
#[structopt(
name = "reset",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
#[structopt(name = "reset", setting(structopt::clap::AppSettings::ColoredHelp))]
ResetOpt(ResetOpt),
/// Start node
#[structopt(name = "start")]
#[structopt(name = "start", setting(structopt::clap::AppSettings::ColoredHelp))]
StartOpt(StartOpt),
/// Synchronize
#[structopt(name = "sync")]
#[structopt(name = "sync", setting(structopt::clap::AppSettings::ColoredHelp))]
SyncOpt(SyncOpt),
/// WS2P1 module subcommand
#[structopt(name = "ws2p1")]
#[structopt(name = "ws2p1", setting(structopt::clap::AppSettings::ColoredHelp))]
Ws2p1(WS2POpt),
}
......@@ -86,7 +86,6 @@ This type represents your module's command line arguments. If it doesn't use any
#[derive(StructOpt, Debug, Clone)]
#[structopt(
name = "skeleton",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
/// YourModule subcommand options
pub struct YourModuleOpt {}
......
......@@ -95,7 +95,6 @@ Exemple de structure vide :
#[derive(StructOpt, Debug, Clone)]
#[structopt(
name = "skeleton",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
/// YourModule subcommand options
pub struct YourModuleOpt {}
......
......@@ -30,7 +30,7 @@ log = "0.4.*"
serde = "1.0.*"
serde_derive = "1.0.*"
serde_json = "1.0.*"
structopt= "0.2.*"
structopt= "0.3.4"
threadpool = "1.7.*"
unwrap = "1.2.1"
......
......@@ -23,10 +23,7 @@ use durs_blockchain::dbex::{DbExBcQuery, DbExQuery, DbExTxQuery, DbExWotQuery};
use durs_conf::DuRsConf;
#[derive(StructOpt, Debug, Clone)]
#[structopt(
name = "dbex",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
#[structopt(name = "dbex", setting(structopt::clap::AppSettings::ColoredHelp))]
/// durs databases explorer
pub struct DbExOpt {
#[structopt(short = "c", long = "csv")]
......@@ -41,40 +38,22 @@ pub struct DbExOpt {
/// dbex subcommands
pub enum DbExSubCommand {
/// Pubkeys’ balances explorer
#[structopt(
name = "balance",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
#[structopt(name = "balance", setting(structopt::clap::AppSettings::ColoredHelp))]
BalanceOpt(BalanceOpt),
/// Display blocks current frame
#[structopt(
name = "blocks",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
#[structopt(name = "blocks", setting(structopt::clap::AppSettings::ColoredHelp))]
BlocksOpt(BlocksOpt),
/// Web of Trust distances explorer
#[structopt(
name = "distance",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
#[structopt(name = "distance", setting(structopt::clap::AppSettings::ColoredHelp))]
DistanceOpt(DistanceOpt),
/// Forks tree explorer
#[structopt(
name = "forks",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
#[structopt(name = "forks", setting(structopt::clap::AppSettings::ColoredHelp))]
ForksOpt(ForksOpt),
/// Member explorer
#[structopt(
name = "member",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
#[structopt(name = "member", setting(structopt::clap::AppSettings::ColoredHelp))]
MemberOpt(MemberOpt),
/// Members explorer
#[structopt(
name = "members",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
#[structopt(name = "members")]
MembersOpt(MembersOpt),
}
......
......@@ -26,7 +26,7 @@ use durs_conf::DuRsConf;
#[structopt(
name = "keys",
author = "inso <inso@tuta.io>",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
setting(structopt::clap::AppSettings::ColoredHelp)
)]
/// keys management
pub struct KeysOpt {
......@@ -42,7 +42,7 @@ pub enum KeysSubCommand {
#[structopt(
name = "modify",
author = "inso <inso@tuta.io>",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
setting(structopt::clap::AppSettings::ColoredHelp)
)]
Modify(ModifyOpt),
......@@ -50,7 +50,7 @@ pub enum KeysSubCommand {
#[structopt(
name = "clear",
author = "inso <inso@tuta.io>",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
setting(structopt::clap::AppSettings::ColoredHelp)
)]
Clear(ClearOpt),
......@@ -58,14 +58,14 @@ pub enum KeysSubCommand {
#[structopt(
name = "show",
author = "inso <inso@tuta.io>",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
setting(structopt::clap::AppSettings::ColoredHelp)
)]
Show(ShowOpt),
#[structopt(
name = "wizard",
author = "inso <inso@tuta.io>",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
setting(structopt::clap::AppSettings::ColoredHelp)
)]
/// Keys generator wizard
Wizard(WizardOpt),
......@@ -82,17 +82,11 @@ pub struct ModifyOpt {
#[derive(StructOpt, Debug, Clone)]
/// keys modify subcommands
pub enum ModifySubCommand {
#[structopt(
name = "member",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
#[structopt(name = "member", setting(structopt::clap::AppSettings::ColoredHelp))]
/// Salt and password of member key
MemberSaltPassword(SaltPasswordOpt),
#[structopt(
name = "network",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
#[structopt(name = "network", setting(structopt::clap::AppSettings::ColoredHelp))]
/// Salt and password of network key
NetworkSaltPassword(SaltPasswordOpt),
}
......
......@@ -23,10 +23,7 @@ use durs_module::*;
use std::collections::HashSet;
#[derive(StructOpt, Debug, Clone)]
#[structopt(
name = "enable",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
#[structopt(name = "enable", setting(structopt::clap::AppSettings::ColoredHelp))]
/// Enable some module
pub struct EnableOpt {
#[structopt(parse(from_str))]
......@@ -46,10 +43,7 @@ impl DursExecutableCoreCommand for EnableOpt {
}
#[derive(StructOpt, Debug, Clone)]
#[structopt(
name = "disable",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
#[structopt(name = "disable", setting(structopt::clap::AppSettings::ColoredHelp))]
/// Disable some module
pub struct DisableOpt {
#[structopt(parse(from_str))]
......@@ -69,10 +63,7 @@ impl DursExecutableCoreCommand for DisableOpt {
}
#[derive(StructOpt, Debug, Copy, Clone)]
#[structopt(
name = "modules",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
#[structopt(name = "modules", setting(structopt::clap::AppSettings::ColoredHelp))]
/// list module
pub struct ListModulesOpt {
#[structopt(short = "d")]
......
......@@ -16,9 +16,6 @@
//! Durs-core cli : start subcommands.
#[derive(StructOpt, Debug, Copy, Clone)]
#[structopt(
name = "start",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
#[structopt(name = "start", setting(structopt::clap::AppSettings::ColoredHelp))]
/// start durs server
pub struct StartOpt {}
......@@ -20,6 +20,6 @@ log = "0.4.*"
serde = "1.0.*"
serde_derive = "1.0.*"
serde_json = "1.0.*"
structopt= "0.2.*"
structopt= "0.3.4"
[features]
......@@ -21,7 +21,7 @@ failure = "0.1.5"
serde = "1.0.*"
serde_derive = "1.0.*"
serde_json = "1.0.*"
structopt= "0.2.*"
structopt= "0.3.4"
[dev-dependencies]
......
......@@ -19,10 +19,7 @@ use durs_network_documents::url::Url;
use std::path::PathBuf;
#[derive(StructOpt, Debug, Clone)]
#[structopt(
name = "sync",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
#[structopt(name = "sync", setting(structopt::clap::AppSettings::ColoredHelp))]
/// Synchronization from network
pub struct SyncOpt {
/// cautious mode (check all protocol rules, very slow)
......
......@@ -169,6 +169,13 @@ impl Url {
Url::UrlWithoutScheme(url_without_scheme) => url_without_scheme.tls(),
}
}
pub fn from_host_port_path(host: Host, port: u16, path: Option<String>) -> Self {
Url::UrlWithoutScheme(UrlWithoutScheme {
host,
port: Some(port),
path,
})
}
pub fn path(&self) -> &str {
match self {
Url::Url(url) => url.path(),
......
......@@ -23,6 +23,6 @@ log = "0.4.*"
serde = "1.0.*"
serde_derive = "1.0.*"
serde_json = "1.0.*"
structopt= "0.2.*"
structopt= "0.3.4"
[features]
......@@ -92,10 +92,7 @@ pub enum SkeletonMsg {
}
#[derive(StructOpt, Debug, Clone)]
#[structopt(
name = "skeleton",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
#[structopt(name = "skeleton", setting(structopt::clap::AppSettings::ColoredHelp))]
/// Skeleton subcommand options
pub struct SkeletonOpt {
/// Change test conf fake field
......
......@@ -24,7 +24,7 @@ log = "0.4.*"
serde = "1.0.*"
serde_derive = "1.0.*"
serde_json = "1.0.*"
structopt= "0.2.*"
structopt= "0.3.4"
termion = "1.5.2"
[features]
......@@ -86,10 +86,7 @@ pub enum TuiMess {
pub struct TuiModule {}
#[derive(StructOpt, Debug, Copy, Clone)]
#[structopt(
name = "tui",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
#[structopt(name = "tui", setting(structopt::clap::AppSettings::ColoredHelp))]
/// Tui subcommand options
pub struct TuiOpt {}
......
......@@ -28,7 +28,7 @@ log = "0.4.*"
maplit = "1.0.1"
serde = { version = "1.0.*", features = ["derive"] }
serde_json = "1.0.*"
structopt= "0.2.*"
structopt= "0.3.4"
unwrap = "1.2.1"
uuid = { version = "0.7.4", features = ["serde", "v4"] }
ws = "0.9.*"
......
......@@ -389,10 +389,7 @@ impl NetworkModule<DuRsConf, DursMsg> for WS2Pv1Module {
}
#[derive(Clone, Debug, StructOpt)]
#[structopt(
name = "ws2p",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
#[structopt(name = "ws2p", setting(structopt::clap::AppSettings::ColoredHelp))]
/// WS2P1 subcommand options
pub struct WS2POpt {
/// Ws2p1 subcommands
......
......@@ -23,10 +23,7 @@ use prefered::Ws2pPreferedSubCommands;
/// Ws2p1 subcommands
pub enum WS2PSubCommands {
/// Prefered keys
#[structopt(
name = "prefered",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
#[structopt(name = "prefered", setting(structopt::clap::AppSettings::ColoredHelp))]
Prefered {
#[structopt(subcommand)]
subcommand: Ws2pPreferedSubCommands,
......
......@@ -26,44 +26,29 @@ use std::str::FromStr;
/// Ws2p1 prefered subcommands
pub enum Ws2pPreferedSubCommands {
/// Add prefered pubkey
#[structopt(
name = "add",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
#[structopt(name = "add", setting(structopt::clap::AppSettings::ColoredHelp))]
Add {
/// Public key to add
public_keys: Vec<PubKey>,
},
/// Add prefered pubkeys from file (one pubkey per line)
#[structopt(
name = "add-file",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
#[structopt(name = "add-file", setting(structopt::clap::AppSettings::ColoredHelp))]
AddFromFile {
/// File path
#[structopt(parse(from_os_str))]
file_path: PathBuf,
},
/// Clear prefered pubkeys
#[structopt(
name = "clear",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
#[structopt(name = "clear", setting(structopt::clap::AppSettings::ColoredHelp))]
Clear,
/// Remove prefered pubkey
#[structopt(
name = "rem",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
#[structopt(name = "rem", setting(structopt::clap::AppSettings::ColoredHelp))]
Rem {
/// Public key to remove
public_keys: Vec<PubKey>,
},
/// Show prefered pubkeys
#[structopt(
name = "show",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
#[structopt(name = "show", setting(structopt::clap::AppSettings::ColoredHelp))]
Show,
}
......
......@@ -29,7 +29,7 @@ maplit = "1.0.1"
serde = "1.0.*"
serde_derive = "1.0.*"
serde_json = "1.0.*"
structopt= "0.2.*"
structopt= "0.3.4"
ws = { version = "0.9.*", features = ["permessage-deflate"] }
[dev-dependencies]
......
......@@ -147,10 +147,7 @@ impl NetworkModule<DuRsConf, DursMsg> for WS2PModule {
}
#[derive(StructOpt, Debug, Copy, Clone)]
#[structopt(
name = "ws2p",
raw(setting = "structopt::clap::AppSettings::ColoredHelp")
)]
#[structopt(name = "ws2p", setting(structopt::clap::AppSettings::ColoredHelp))]
/// WS2P subcommand options
pub struct WS2POpt {}
......
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