Skip to content

Commit

Permalink
Rename application-handled -h CLI flags to -H (#1743)
Browse files Browse the repository at this point in the history
* Disambiguate between help and height flags by using `-H` for the latter

* Enable clap-provided help flags on all subcommands

Since all application-assigned short -h options have been renamed to -H,
there is no need to suppress the -h flags provided by clap with the
DisableHelpFlag setting.

* Update changelog for #1743

* Remove a FIXME comment

Resolved by e59bb13

Co-authored-by: Romain Ruetschi <romain@informal.systems>
  • Loading branch information
mzabaluev and romac committed Jan 10, 2022
1 parent 5ec22be commit 8edbf60
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
`--help` flags in subcommands and improving help and usage printouts.
The `--version` option of the `create channel` subcommand has been renamed
to `--channel-version`, with the old name still supported as an alias.
([#1576](https://github.com/informalsystems/ibc-rs/pull/1576))
([#1576](https://github.com/informalsystems/ibc-rs/pull/1576),
[#1743](https://github.com/informalsystems/ibc-rs/pull/1743))
2 changes: 0 additions & 2 deletions relayer-cli/src/commands/query/channel.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use alloc::sync::Arc;

use abscissa_core::{Clap, Command, Runnable};
use clap::AppSettings::DisableHelpFlag;
use tokio::runtime::Runtime as TokioRuntime;

use ibc::core::ics24_host::identifier::ChainId;
Expand All @@ -13,7 +12,6 @@ use crate::prelude::*;
use ibc::core::ics04_channel::channel::State;

#[derive(Clone, Command, Debug, Clap)]
#[clap(setting(DisableHelpFlag))]
pub struct QueryChannelEndCmd {
#[clap(required = true, about = "identifier of the chain to query")]
chain_id: ChainId,
Expand Down
2 changes: 0 additions & 2 deletions relayer-cli/src/commands/query/channel_ends.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use abscissa_core::{Clap, Command, Runnable};
use clap::AppSettings::DisableHelpFlag;
use serde::{Deserialize, Serialize};

use ibc::core::ics02_client::client_state::{AnyClientState, ClientState};
Expand All @@ -15,7 +14,6 @@ use crate::conclude::Output;
use crate::prelude::*;

#[derive(Clone, Command, Debug, Clap)]
#[clap(setting(DisableHelpFlag))]
pub struct QueryChannelEndsCmd {
#[clap(required = true, about = "identifier of the chain to query")]
chain_id: ChainId,
Expand Down
3 changes: 0 additions & 3 deletions relayer-cli/src/commands/query/client.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use alloc::sync::Arc;

use abscissa_core::{Clap, Command, Runnable};
use clap::AppSettings::DisableHelpFlag;
use tokio::runtime::Runtime as TokioRuntime;
use tracing::debug;

Expand All @@ -22,7 +21,6 @@ use crate::conclude::{exit_with_unrecoverable_error, Output};

/// Query client state command
#[derive(Clone, Command, Debug, Clap)]
#[clap(setting(DisableHelpFlag))]
pub struct QueryClientStateCmd {
#[clap(required = true, about = "identifier of the chain to query")]
chain_id: ChainId,
Expand Down Expand Up @@ -160,7 +158,6 @@ impl Runnable for QueryClientConsensusCmd {
}

#[derive(Clone, Command, Debug, Clap)]
#[clap(setting(DisableHelpFlag))]
pub struct QueryClientHeaderCmd {
#[clap(required = true, about = "identifier of the chain to query")]
chain_id: ChainId,
Expand Down
2 changes: 0 additions & 2 deletions relayer-cli/src/commands/query/connection.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use alloc::sync::Arc;

use abscissa_core::{Clap, Command, Runnable};
use clap::AppSettings::DisableHelpFlag;
use tokio::runtime::Runtime as TokioRuntime;

use ibc::core::{
Expand All @@ -17,7 +16,6 @@ use crate::error::Error;
use crate::prelude::*;

#[derive(Clone, Command, Debug, Clap)]
#[clap(setting(DisableHelpFlag))]
pub struct QueryConnectionEndCmd {
#[clap(required = true, about = "identifier of the chain to query")]
chain_id: ChainId,
Expand Down
2 changes: 0 additions & 2 deletions relayer-cli/src/commands/query/packet/ack.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use abscissa_core::{Clap, Command, Runnable};
use clap::AppSettings::DisableHelpFlag;
use subtle_encoding::{Encoding, Hex};

use ibc::core::ics04_channel::packet::{PacketMsgType, Sequence};
Expand All @@ -13,7 +12,6 @@ use crate::error::Error;
use crate::prelude::*;

#[derive(Clone, Command, Debug, Clap)]
#[clap(setting(DisableHelpFlag))]
pub struct QueryPacketAcknowledgmentCmd {
#[clap(required = true, about = "identifier of the chain to query")]
chain_id: ChainId,
Expand Down
2 changes: 0 additions & 2 deletions relayer-cli/src/commands/query/packet/commitment.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use abscissa_core::{Clap, Command, Runnable};
use clap::AppSettings::DisableHelpFlag;
use serde::Serialize;
use subtle_encoding::{Encoding, Hex};

Expand All @@ -20,7 +19,6 @@ struct PacketSeqs {
}

#[derive(Clone, Command, Debug, Clap)]
#[clap(setting(DisableHelpFlag))]
pub struct QueryPacketCommitmentCmd {
#[clap(required = true, about = "identifier of the chain to query")]
chain_id: ChainId,
Expand Down
2 changes: 0 additions & 2 deletions relayer-cli/src/commands/tx/client.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use core::fmt;

use abscissa_core::{Clap, Command, Runnable};
use clap::AppSettings::DisableHelpFlag;

use ibc::core::ics02_client::client_state::ClientState;
use ibc::core::ics24_host::identifier::{ChainId, ClientId};
Expand Down Expand Up @@ -55,7 +54,6 @@ impl Runnable for TxCreateClientCmd {
}

#[derive(Clone, Command, Debug, Clap)]
#[clap(setting(DisableHelpFlag))]
pub struct TxUpdateClientCmd {
#[clap(required = true, about = "identifier of the destination chain")]
dst_chain_id: ChainId,
Expand Down

0 comments on commit 8edbf60

Please sign in to comment.