Skip to content

Commit d4e12f6

Browse files
committed
Drop config path as CLI arg
1 parent 1a7f8f6 commit d4e12f6

4 files changed

Lines changed: 3 additions & 14 deletions

File tree

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/custom-fields/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ hotfix-message = { path = "../../crates/hotfix-message" }
1212

1313
anyhow.workspace = true
1414
async-trait.workspace = true
15-
clap = { workspace = true, features = ["derive"] }
1615
tokio = { workspace = true, features = ["full"] }
1716
tracing.workspace = true
1817
tracing-subscriber = { workspace = true, features = ["env-filter"] }

examples/custom-fields/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ docker compose -f example.compose.yml up --build dummy-executor
4444
In another, from the repo root, run the example:
4545

4646
```shell
47-
cargo run -p custom-fields -- --config examples/custom-fields/config/test-config.toml
47+
cargo run -p custom-fields
4848
```
4949

5050
Expected log output:

examples/custom-fields/src/main.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use std::sync::Arc;
66
use std::time::Duration;
77

88
use anyhow::{Context, Result, anyhow};
9-
use clap::Parser;
109
use hotfix::config::Config;
1110
use hotfix::field_types::Timestamp;
1211
use hotfix::initiator::Initiator;
@@ -19,27 +18,19 @@ use tracing_subscriber::EnvFilter;
1918
use crate::application::TestApplication;
2019
use crate::messages::{ExecReportSummary, NewOrderSingle, OutboundMsg};
2120

21+
const CONFIG_PATH: &str = "examples/custom-fields/config/test-config.toml";
2222
const LOGON_TIMEOUT: Duration = Duration::from_secs(10);
2323
const FILL_TIMEOUT: Duration = Duration::from_secs(10);
2424
const STRATEGY_ID: i32 = 42;
2525
const CL_ORD_ID: &str = "demo-1";
2626

27-
#[derive(Parser, Debug)]
28-
#[command(author, version, about)]
29-
struct Args {
30-
#[arg(short, long)]
31-
config: String,
32-
}
33-
3427
#[tokio::main]
3528
async fn main() -> Result<()> {
36-
let args = Args::parse();
37-
3829
tracing_subscriber::fmt()
3930
.with_env_filter(EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info")))
4031
.init();
4132

42-
let mut config = Config::load_from_path(&args.config)
33+
let mut config = Config::load_from_path(CONFIG_PATH)
4334
.context("failed to load config")?;
4435
let session_config = config
4536
.sessions

0 commit comments

Comments
 (0)