Skip to content

Commit 4fb92a7

Browse files
committed
Update clap dependency and address the breaking changes
1 parent 9a96231 commit 4fb92a7

File tree

5 files changed

+28
-21
lines changed

5 files changed

+28
-21
lines changed

cargo-espflash/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ categories = [
2727
[dependencies]
2828
cargo_metadata = "0.14"
2929
cargo_toml = "0.10"
30-
clap = "3.0.0-beta.5"
30+
clap = "3.0.0-rc.1"
31+
clap_derive = "3.0.0-rc.1"
3132
crossterm = "0.22"
3233
espflash = { version = "1", path = "../espflash" }
3334
miette = { version = "3", features = ["fancy"] }

cargo-espflash/src/main.rs

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
1-
use crate::cargo_config::CargoConfig;
2-
use crate::error::NoTargetError;
3-
use crate::{cargo_config::parse_cargo_config, error::UnsupportedTargetError};
1+
use std::{
2+
fs,
3+
path::PathBuf,
4+
process::{exit, Command, ExitStatus, Stdio},
5+
str::FromStr,
6+
};
7+
48
use cargo_metadata::Message;
5-
use clap::{AppSettings, Parser};
6-
use error::Error;
9+
use clap::{AppSettings, Parser as _};
10+
use clap_derive::Parser;
711
use espflash::{
812
cli::{clap::*, connect, monitor::monitor},
913
Chip, Config, FirmwareImage, ImageFormatId, PartitionTable,
1014
};
1115
use miette::{IntoDiagnostic, Result, WrapErr};
12-
use package_metadata::CargoEspFlashMeta;
13-
use std::{
14-
fs,
15-
path::PathBuf,
16-
process::{exit, Command, ExitStatus, Stdio},
17-
str::FromStr,
16+
17+
use crate::{
18+
cargo_config::{parse_cargo_config, CargoConfig},
19+
error::{Error, NoTargetError, UnsupportedTargetError},
20+
package_metadata::CargoEspFlashMeta,
1821
};
22+
1923
mod cargo_config;
2024
mod error;
2125
mod package_metadata;

espflash/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ binread = "2"
2020
bytemuck = { version = "1", features = ["derive"] }
2121
indicatif = "0.16"
2222
md5 = "0.7"
23-
clap = "3.0.0-beta.5"
23+
clap = "3.0.0-rc.1"
24+
clap_derive = "3.0.0-rc.1"
2425
serialport = "4"
2526
sha2 = "0.9"
2627
slip-codec = "0.3"

espflash/src/cli/clap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use clap::Parser;
1+
use clap_derive::Parser;
22

33
#[derive(Parser)]
44
pub struct ConnectArgs {

espflash/src/main.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
use clap::{AppSettings, IntoApp, Parser};
2-
use espflash::cli::monitor::monitor;
3-
use espflash::{
4-
cli::{clap::*, connect},
5-
Chip, Config, Error, FirmwareImage, ImageFormatId, PartitionTable,
6-
};
7-
use miette::{IntoDiagnostic, Result, WrapErr};
81
use std::{
92
fs::{self, read, read_to_string},
103
mem::swap,
114
str::FromStr,
125
};
136

7+
use clap::{AppSettings, IntoApp, Parser as _};
8+
use clap_derive::Parser;
9+
use espflash::{
10+
cli::{clap::*, connect, monitor::monitor},
11+
Chip, Config, Error, FirmwareImage, ImageFormatId, PartitionTable,
12+
};
13+
use miette::{IntoDiagnostic, Result, WrapErr};
14+
1415
#[derive(Parser)]
1516
#[clap(global_setting = AppSettings::PropagateVersion)]
1617
#[clap(version = env!("CARGO_PKG_VERSION"))]

0 commit comments

Comments
 (0)