Skip to content

Commit

Permalink
[#59] feat(bin): add default configuration file paths (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
M0dEx committed Jun 6, 2024
1 parent 3303560 commit d9b4c83
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 28 deletions.
44 changes: 22 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "quincy"
version = "0.9.0"
version = "0.9.1"
authors = ["Jakub Kubík <[email protected]>"]
license = "MIT"
description = "QUIC-based VPN"
Expand Down
4 changes: 2 additions & 2 deletions src/bin/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use tun2::AsyncDevice;
#[derive(Parser)]
#[command(name = "quincy")]
pub struct Args {
#[arg(long)]
#[arg(long, default_value = "client.toml")]
pub config_path: PathBuf,
#[arg(long, default_value = "QUINCY_")]
pub env_prefix: String,
Expand All @@ -34,7 +34,7 @@ async fn main() {

/// Runs the Quincy client.
async fn run_client() -> Result<()> {
let args = Args::try_parse()?;
let args = Args::parse();
let config = ClientConfig::from_path(&args.config_path, &args.env_prefix)?;
// Enable tracing with the log level from the configuration.
tracing::subscriber::set_global_default(log_subscriber(&config.log.level))?;
Expand Down
4 changes: 2 additions & 2 deletions src/bin/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use tun2::AsyncDevice;
#[derive(Parser)]
#[command(name = "quincy")]
pub struct Args {
#[arg(long)]
#[arg(long, default_value = "server.toml")]
pub config_path: PathBuf,
#[arg(long, default_value = "QUINCY_")]
pub env_prefix: String,
Expand All @@ -34,7 +34,7 @@ async fn main() {

/// Runs the Quincy server.
async fn run_server() -> Result<()> {
let args = Args::try_parse()?;
let args = Args::parse();
let config = ServerConfig::from_path(&args.config_path, &args.env_prefix)?;
// Enable tracing with the log level from the configuration.
tracing::subscriber::set_global_default(log_subscriber(&config.log.level))?;
Expand Down
2 changes: 1 addition & 1 deletion src/bin/users.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub struct Args {
pub add: bool,
#[arg(short, long, group = "mode")]
pub delete: bool,
#[arg(requires = "mode")]
#[arg(requires = "mode", default_value = "users")]
pub users_file_path: PathBuf,
}

Expand Down

0 comments on commit d9b4c83

Please sign in to comment.