cli: clap 3.0.x (#1370)
This commit is contained in:
parent
aa0ad43810
commit
e6333e3554
|
@ -115,7 +115,7 @@ version = "0.20.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anchor-syn",
|
"anchor-syn",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"heck",
|
"heck 0.3.3",
|
||||||
"proc-macro2 1.0.32",
|
"proc-macro2 1.0.32",
|
||||||
"quote 1.0.10",
|
"quote 1.0.10",
|
||||||
"syn 1.0.81",
|
"syn 1.0.81",
|
||||||
|
@ -153,10 +153,10 @@ dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"cargo_toml",
|
"cargo_toml",
|
||||||
"chrono",
|
"chrono",
|
||||||
"clap 3.0.0-beta.4",
|
"clap 3.0.13",
|
||||||
"dirs",
|
"dirs",
|
||||||
"flate2",
|
"flate2",
|
||||||
"heck",
|
"heck 0.3.3",
|
||||||
"pathdiff",
|
"pathdiff",
|
||||||
"rand 0.7.3",
|
"rand 0.7.3",
|
||||||
"reqwest",
|
"reqwest",
|
||||||
|
@ -240,7 +240,7 @@ version = "0.20.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"bs58 0.3.1",
|
"bs58 0.3.1",
|
||||||
"heck",
|
"heck 0.3.3",
|
||||||
"proc-macro2 1.0.32",
|
"proc-macro2 1.0.32",
|
||||||
"proc-macro2-diagnostics",
|
"proc-macro2-diagnostics",
|
||||||
"quote 1.0.10",
|
"quote 1.0.10",
|
||||||
|
@ -666,9 +666,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap"
|
name = "clap"
|
||||||
version = "3.0.0-beta.4"
|
version = "3.0.13"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fcd70aa5597dbc42f7217a543f9ef2768b2ef823ba29036072d30e1d88e98406"
|
checksum = "08799f92c961c7a1cf0cc398a9073da99e21ce388b46372c37f3191f2f3eed3e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atty",
|
"atty",
|
||||||
"bitflags",
|
"bitflags",
|
||||||
|
@ -679,16 +679,15 @@ dependencies = [
|
||||||
"strsim 0.10.0",
|
"strsim 0.10.0",
|
||||||
"termcolor",
|
"termcolor",
|
||||||
"textwrap 0.14.2",
|
"textwrap 0.14.2",
|
||||||
"vec_map",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap_derive"
|
name = "clap_derive"
|
||||||
version = "3.0.0-beta.4"
|
version = "3.0.12"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0b5bb0d655624a0b8770d1c178fb8ffcb1f91cc722cb08f451e3dc72465421ac"
|
checksum = "0fd2078197a22f338bd4fbf7d6387eb6f0d6a3c69e6cbc09f5c93e97321fd92a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"heck",
|
"heck 0.4.0",
|
||||||
"proc-macro-error",
|
"proc-macro-error",
|
||||||
"proc-macro2 1.0.32",
|
"proc-macro2 1.0.32",
|
||||||
"quote 1.0.10",
|
"quote 1.0.10",
|
||||||
|
@ -1472,6 +1471,12 @@ dependencies = [
|
||||||
"unicode-segmentation",
|
"unicode-segmentation",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "heck"
|
||||||
|
version = "0.4.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hermit-abi"
|
name = "hermit-abi"
|
||||||
version = "0.1.19"
|
version = "0.1.19"
|
||||||
|
@ -2121,9 +2126,12 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "os_str_bytes"
|
name = "os_str_bytes"
|
||||||
version = "3.1.0"
|
version = "6.0.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6acbef58a60fe69ab50510a55bc8cdd4d6cf2283d27ad338f54cb52747a9cf2d"
|
checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64"
|
||||||
|
dependencies = [
|
||||||
|
"memchr",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ouroboros"
|
name = "ouroboros"
|
||||||
|
@ -3721,9 +3729,6 @@ name = "textwrap"
|
||||||
version = "0.14.2"
|
version = "0.14.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0066c8d12af8b5acd21e00547c3797fde4e8677254a7ee429176ccebbe93dd80"
|
checksum = "0066c8d12af8b5acd21e00547c3797fde4e8677254a7ee429176ccebbe93dd80"
|
||||||
dependencies = [
|
|
||||||
"unicode-width",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "thiserror"
|
name = "thiserror"
|
||||||
|
|
|
@ -13,7 +13,7 @@ dev = []
|
||||||
default = []
|
default = []
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = "3.0.0-beta.1"
|
clap = { version = "3.0.13", features = ["derive"] }
|
||||||
anyhow = "1.0.32"
|
anyhow = "1.0.32"
|
||||||
syn = { version = "1.0.60", features = ["full", "extra-traits"] }
|
syn = { version = "1.0.60", features = ["full", "extra-traits"] }
|
||||||
anchor-lang = { path = "../lang" }
|
anchor-lang = { path = "../lang" }
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use anchor_cli::Opts;
|
use anchor_cli::Opts;
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use clap::Clap;
|
use clap::Parser;
|
||||||
|
|
||||||
fn main() -> Result<()> {
|
fn main() -> Result<()> {
|
||||||
anchor_cli::entry(Opts::parse())
|
anchor_cli::entry(Opts::parse())
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use anchor_client::Cluster;
|
use anchor_client::Cluster;
|
||||||
use anchor_syn::idl::Idl;
|
use anchor_syn::idl::Idl;
|
||||||
use anyhow::{anyhow, Error, Result};
|
use anyhow::{anyhow, Error, Result};
|
||||||
use clap::{ArgEnum, Clap};
|
use clap::{ArgEnum, Parser};
|
||||||
use heck::SnakeCase;
|
use heck::SnakeCase;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use solana_sdk::pubkey::Pubkey;
|
use solana_sdk::pubkey::Pubkey;
|
||||||
|
@ -15,7 +15,7 @@ use std::path::Path;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
#[derive(Default, Debug, Clap)]
|
#[derive(Default, Debug, Parser)]
|
||||||
pub struct ConfigOverride {
|
pub struct ConfigOverride {
|
||||||
/// Cluster override.
|
/// Cluster override.
|
||||||
#[clap(global = true, long = "provider.cluster")]
|
#[clap(global = true, long = "provider.cluster")]
|
||||||
|
@ -294,7 +294,7 @@ pub struct WorkspaceConfig {
|
||||||
pub types: String,
|
pub types: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(ArgEnum, Clap, Clone, PartialEq, Debug)]
|
#[derive(ArgEnum, Parser, Clone, PartialEq, Debug)]
|
||||||
pub enum BootstrapMode {
|
pub enum BootstrapMode {
|
||||||
None,
|
None,
|
||||||
Debian,
|
Debian,
|
||||||
|
|
|
@ -7,7 +7,7 @@ use anchor_lang::idl::{IdlAccount, IdlInstruction};
|
||||||
use anchor_lang::{AccountDeserialize, AnchorDeserialize, AnchorSerialize};
|
use anchor_lang::{AccountDeserialize, AnchorDeserialize, AnchorSerialize};
|
||||||
use anchor_syn::idl::Idl;
|
use anchor_syn::idl::Idl;
|
||||||
use anyhow::{anyhow, Context, Result};
|
use anyhow::{anyhow, Context, Result};
|
||||||
use clap::Clap;
|
use clap::Parser;
|
||||||
use flate2::read::GzDecoder;
|
use flate2::read::GzDecoder;
|
||||||
use flate2::read::ZlibDecoder;
|
use flate2::read::ZlibDecoder;
|
||||||
use flate2::write::{GzEncoder, ZlibEncoder};
|
use flate2::write::{GzEncoder, ZlibEncoder};
|
||||||
|
@ -48,7 +48,7 @@ pub mod template;
|
||||||
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
|
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||||
pub const DOCKER_BUILDER_VERSION: &str = VERSION;
|
pub const DOCKER_BUILDER_VERSION: &str = VERSION;
|
||||||
|
|
||||||
#[derive(Debug, Clap)]
|
#[derive(Debug, Parser)]
|
||||||
#[clap(version = VERSION)]
|
#[clap(version = VERSION)]
|
||||||
pub struct Opts {
|
pub struct Opts {
|
||||||
#[clap(flatten)]
|
#[clap(flatten)]
|
||||||
|
@ -57,7 +57,7 @@ pub struct Opts {
|
||||||
pub command: Command,
|
pub command: Command,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clap)]
|
#[derive(Debug, Parser)]
|
||||||
pub enum Command {
|
pub enum Command {
|
||||||
/// Initializes a workspace.
|
/// Initializes a workspace.
|
||||||
Init {
|
Init {
|
||||||
|
@ -261,12 +261,12 @@ pub enum Command {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clap)]
|
#[derive(Debug, Parser)]
|
||||||
pub enum KeysCommand {
|
pub enum KeysCommand {
|
||||||
List,
|
List,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clap)]
|
#[derive(Debug, Parser)]
|
||||||
pub enum IdlCommand {
|
pub enum IdlCommand {
|
||||||
/// Initializes a program's IDL account. Can only be run once.
|
/// Initializes a program's IDL account. Can only be run once.
|
||||||
Init {
|
Init {
|
||||||
|
@ -341,7 +341,7 @@ pub enum IdlCommand {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clap)]
|
#[derive(Debug, Parser)]
|
||||||
pub enum ClusterCommand {
|
pub enum ClusterCommand {
|
||||||
/// Prints common cluster urls.
|
/// Prints common cluster urls.
|
||||||
List,
|
List,
|
||||||
|
|
Loading…
Reference in New Issue