Skip to content

Commit

Permalink
fix: Fix help generation
Browse files Browse the repository at this point in the history
  • Loading branch information
fmoura committed Sep 19, 2023
1 parent 292ff68 commit d843d18
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 31 deletions.
11 changes: 1 addition & 10 deletions .github/workflows/rust-code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,7 @@ jobs:
with:
submodules: recursive

- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
offchain/target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-


- name: Install protoc
run: sudo apt update && sudo apt install -y protobuf-compiler libprotobuf-dev
Expand Down
3 changes: 2 additions & 1 deletion offchain/advance-runner/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ pub enum ConfigError {
SnapshotConfigError { source: SnapshotConfigError },
}

#[derive(Parser, Debug)]
#[derive(Debug, Parser)]
#[command(name = "advance_runner_config")]
struct CLIConfig {
#[command(flatten)]
sm_cli_config: ServerManagerCLIConfig,
Expand Down
4 changes: 2 additions & 2 deletions offchain/advance-runner/src/server_manager/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ impl ServerManagerConfig {
}
}

#[derive(Parser, Debug)]
#[command(name = "server-manager")]
#[derive(Debug, Parser)]
#[command(name = "server_manager_config")]
pub struct ServerManagerCLIConfig {
/// Server-manager gRPC endpoint
#[arg(long, env, default_value = "http://127.0.0.1:5001")]
Expand Down
2 changes: 1 addition & 1 deletion offchain/advance-runner/src/snapshot/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub enum SnapshotConfigError {
NoProviderEndpointError {},
}

#[derive(Parser, Debug)]
#[derive(Clone, Parser, Debug)]
#[command(name = "snapshot")]
pub struct SnapshotCLIConfig {
/// If set to false, disables snapshots. Enabled by default
Expand Down
8 changes: 3 additions & 5 deletions offchain/authority-claimer/src/config/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ use crate::config::{
// AuthorityClaimerCLI
// ------------------------------------------------------------------------------------------------

#[derive(Clone, Parser)]
#[command(name = "rd_config")]
#[command(about = "Configuration for rollups authority claimer")]
#[derive(Debug, Parser)]
#[command(name = "authority_claimer_config")]
pub(crate) struct AuthorityClaimerCLI {
#[command(flatten)]
tx_manager_config: TxManagerCLIConfig,
Expand Down Expand Up @@ -83,9 +82,8 @@ impl TryFrom<AuthorityClaimerCLI> for AuthorityClaimerConfig {
// TxSigningConfig
// ------------------------------------------------------------------------------------------------

#[derive(Debug, Clone, Parser)]
#[derive(Debug, Parser)]
#[command(name = "tx_signing_config")]
#[command(about = "Configuration for signing transactions")]
pub(crate) struct TxSigningCLIConfig {
/// Signer mnemonic, overrides `tx_signing_mnemonic_file` and `tx_signing_aws_kms_*`
#[arg(long, env)]
Expand Down
2 changes: 1 addition & 1 deletion offchain/data/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl RepositoryConfig {
}
}

#[derive(Parser)]
#[derive(Debug, Parser)]
pub struct RepositoryCLIConfig {
#[arg(long, env, default_value = "postgres")]
postgres_user: String,
Expand Down
3 changes: 1 addition & 2 deletions offchain/dispatcher/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ use types::deployment_files::{

use crate::auth::{AuthConfig, AuthEnvCLIConfig, AuthError};

#[derive(Clone, Parser)]
#[derive(Debug, Parser)]
#[command(name = "rd_config")]
#[command(about = "Configuration for rollups dispatcher")]
pub struct DispatcherEnvCLIConfig {
#[command(flatten)]
pub sc_config: SCEnvCLIConfig,
Expand Down
3 changes: 2 additions & 1 deletion offchain/graphql-server/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ pub struct GraphQLConfig {
pub healthcheck_port: u16,
}

#[derive(Parser)]
#[derive(Debug, Parser)]
#[command(name = "graphql_server_config")]
pub struct CLIConfig {
#[command(flatten)]
repository_config: RepositoryCLIConfig,
Expand Down
3 changes: 2 additions & 1 deletion offchain/host-runner/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ pub struct Config {
pub healthcheck_port: u16,
}

#[derive(Parser, Clone, Debug)]
#[derive(Debug, Parser)]
#[command(name = "host_runner_config")]
pub struct CLIConfig {
/// Logs Config
#[command(flatten)]
Expand Down
3 changes: 2 additions & 1 deletion offchain/indexer/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ pub struct IndexerConfig {
pub healthcheck_port: u16,
}

#[derive(Parser)]
#[derive(Debug, Parser)]
#[command(name = "indexer_config")]
pub struct CLIConfig {
#[command(flatten)]
repository_config: RepositoryCLIConfig,
Expand Down
3 changes: 2 additions & 1 deletion offchain/inspect-server/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ pub struct InspectServerConfig {
pub healthcheck_port: u16,
}

#[derive(Parser)]
#[derive(Debug, Parser)]
#[command(name = "inspect_server_config")]
pub struct CLIConfig {
#[command(flatten)]
pub log_config: LogEnvCliConfig,
Expand Down
3 changes: 1 addition & 2 deletions offchain/log/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
use clap::Parser;
use tracing_subscriber::filter::{EnvFilter, LevelFilter};

#[derive(Clone, Parser, Debug)]
#[derive(Debug, Parser)]
#[command(name = "log_config")]
#[command(about = "Configuration for Logs")]
pub struct LogEnvCliConfig {
#[arg(long, env, default_value = "false")]
pub log_enable_timestamp: bool,
Expand Down
2 changes: 1 addition & 1 deletion offchain/rollups-events/src/broker/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ pub enum BrokerError {
InvalidPayload { source: serde_json::Error },
}

#[derive(Debug, Clone, Parser)]
#[derive(Debug, Parser)]
#[command(name = "broker")]
pub struct BrokerCLIConfig {
/// Redis address
Expand Down
3 changes: 1 addition & 2 deletions offchain/state-server/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ use eth_state_server_lib::config::{
};
use log::{LogConfig, LogEnvCliConfig};

#[derive(Debug, Clone, Parser)]
#[derive(Debug, Parser)]
#[command(name = "state_server_config")]
#[command(about = "Configuration for state-fold state-server")]
pub struct EnvCLIConfig {
#[command(flatten)]
pub state_server_config: StateServerEnvCLIConfig,
Expand Down

0 comments on commit d843d18

Please sign in to comment.