Skip to content

Commit

Permalink
chore: flip --no-locked flag for abi command
Browse files Browse the repository at this point in the history
  • Loading branch information
dj8yf0μl committed Dec 4, 2024
1 parent 3a2276d commit 499ccc1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion cargo-near-build/src/types/cargo/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@ fn get_cargo_metadata(
);
println!(
"{}",
"You can choose to disable `--locked` flag for downstream `cargo` command with `--no-locked` flag.".cyan()
"You can choose to disable `--locked` flag for downstream `cargo` command \
by adding `--no-locked` flag OR by removing `--locked` flag"
.cyan()
);
thread::sleep(Duration::new(5, 0));
return Err(cargo_metadata::Error::CargoMetadata {
Expand Down
8 changes: 4 additions & 4 deletions cargo-near/src/commands/abi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ use cargo_near_build::abi::AbiOpts;
#[interactive_clap(input_context = near_cli_rs::GlobalContext)]
#[interactive_clap(output_context = AbiCommandlContext)]
pub struct AbiCommand {
/// disable implicit `--locked` flag for all `cargo` commands, enabled by default
/// enable implicit `--locked` flag for all `cargo` commands, disabled by default
#[interactive_clap(long)]
pub no_locked: bool,
pub locked: bool,
/// Include rustdocs in the ABI file
#[interactive_clap(long)]
pub no_doc: bool,
Expand All @@ -31,7 +31,7 @@ pub struct AbiCommand {
impl From<AbiCommand> for AbiOpts {
fn from(value: AbiCommand) -> Self {
Self {
no_locked: value.no_locked,
no_locked: !value.locked,
no_doc: value.no_doc,
compact_abi: value.compact_abi,
out_dir: value.out_dir.map(Into::into),
Expand All @@ -50,7 +50,7 @@ impl AbiCommandlContext {
scope: &<AbiCommand as interactive_clap::ToInteractiveClapContextScope>::InteractiveClapContextScope,
) -> color_eyre::eyre::Result<Self> {
let args = AbiCommand {
no_locked: scope.no_locked,
locked: scope.locked,
no_doc: scope.no_doc,
compact_abi: scope.compact_abi,
out_dir: scope.out_dir.clone(),
Expand Down

0 comments on commit 499ccc1

Please sign in to comment.