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 20, 2023
1 parent 5a7c4a7 commit 9280dc4
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 19 deletions.
4 changes: 3 additions & 1 deletion offchain/advance-runner/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ pub enum ConfigError {
SnapshotConfigError { source: SnapshotConfigError },
}

#[derive(Parser, Debug)]
#[derive(Parser)]
#[command(name = "advance_runner_config")]
#[command(about = "Configuration for advance-runner")]
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
9 changes: 4 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,9 @@ use crate::config::{
// AuthorityClaimerCLI
// ------------------------------------------------------------------------------------------------

#[derive(Clone, Parser)]
#[command(name = "rd_config")]
#[command(about = "Configuration for rollups authority claimer")]
#[derive(Parser)]
#[command(name = "authority_claimer_config")]
#[command(about = "Configuration for authority-claimer")]
pub(crate) struct AuthorityClaimerCLI {
#[command(flatten)]
tx_manager_config: TxManagerCLIConfig,
Expand Down Expand Up @@ -83,9 +83,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
4 changes: 2 additions & 2 deletions offchain/dispatcher/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ use types::deployment_files::{

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

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

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

#[derive(Parser, Clone, Debug)]
#[derive(Parser)]
#[command(name = "host_runner_config")]
#[command(about = "Configuration for host-runner")]
pub struct CLIConfig {
/// Logs Config
#[command(flatten)]
Expand Down
2 changes: 2 additions & 0 deletions offchain/indexer/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ pub struct IndexerConfig {
}

#[derive(Parser)]
#[command(name = "indexer_config")]
#[command(about = "Configuration for indexer")]
pub struct CLIConfig {
#[command(flatten)]
repository_config: RepositoryCLIConfig,
Expand Down
1 change: 0 additions & 1 deletion offchain/indexer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
use clap::Parser;

use indexer::{CLIConfig, IndexerConfig};
use log;
use tracing::info;

#[tokio::main]
Expand Down
2 changes: 2 additions & 0 deletions offchain/inspect-server/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ pub struct InspectServerConfig {
}

#[derive(Parser)]
#[command(name = "inspect_server_config")]
#[command(about = "Configuration for inspect-server")]
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
4 changes: 2 additions & 2 deletions offchain/state-server/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ use eth_state_server_lib::config::{
};
use log::{LogConfig, LogEnvCliConfig};

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

0 comments on commit 9280dc4

Please sign in to comment.