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 8bae15e
Show file tree
Hide file tree
Showing 15 changed files with 19 additions and 29 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(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(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(Parser)]
#[command(name = "rd_config")]
#[command(about = "Configuration for rollups dispatcher")]
pub struct DispatcherEnvCLIConfig {
#[command(flatten)]
pub sc_config: SCEnvCLIConfig,
Expand Down
1 change: 1 addition & 0 deletions offchain/graphql-server/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub struct GraphQLConfig {
}

#[derive(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(Parser)]
#[command(name = "host_runner_config")]
pub struct CLIConfig {
/// Logs Config
#[command(flatten)]
Expand Down
1 change: 1 addition & 0 deletions offchain/indexer/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub struct IndexerConfig {
}

#[derive(Parser)]
#[command(name = "indexer_config")]
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
1 change: 1 addition & 0 deletions offchain/inspect-server/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pub struct InspectServerConfig {
}

#[derive(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(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 8bae15e

Please sign in to comment.