diff --git a/README.md b/README.md index ae51568..4b82aa5 100644 --- a/README.md +++ b/README.md @@ -19,21 +19,25 @@ Usage: dreamhost-ddns.exe [OPTIONS] Options: -v, --verbose - -c, --config [default: config.toml] + -c, --config [default: config.toml] --dry-run - -h, --help Print help - -V, --version Print version + --api-key + --record + -h, --help Print help + -V, --version Print version ``` ### Linux / Others ``` -Usage: dreamhost-ddns [OPTIONS] +Usage: dreamhost-ddns.exe [OPTIONS] Options: -v, --verbose - -c, --config [default: config.toml] + -c, --config [default: config.toml] --dry-run - -h, --help Print help - -V, --version Print version + --api-key + --record + -h, --help Print help + -V, --version Print version ``` You will likely need to make the dreamhost-ddns file executable first: ```bash diff --git a/binaries/linux-aarch64/dreamhost-ddns b/binaries/linux-aarch64/dreamhost-ddns index 3ec403d..2fc1b5c 100644 Binary files a/binaries/linux-aarch64/dreamhost-ddns and b/binaries/linux-aarch64/dreamhost-ddns differ diff --git a/binaries/linux-rpi-armv7/dreamhost-ddns b/binaries/linux-rpi-armv7/dreamhost-ddns index 0f5d78a..14fa241 100644 Binary files a/binaries/linux-rpi-armv7/dreamhost-ddns and b/binaries/linux-rpi-armv7/dreamhost-ddns differ diff --git a/binaries/linux-x86_64/dreamhost-ddns b/binaries/linux-x86_64/dreamhost-ddns index d3f6348..f7b48ca 100644 Binary files a/binaries/linux-x86_64/dreamhost-ddns and b/binaries/linux-x86_64/dreamhost-ddns differ diff --git a/binaries/windows/dreamhost-ddns.exe b/binaries/windows/dreamhost-ddns.exe index 2f5e342..325f42c 100644 Binary files a/binaries/windows/dreamhost-ddns.exe and b/binaries/windows/dreamhost-ddns.exe differ diff --git a/src/main.rs b/src/main.rs index ce96ed6..cd44793 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,6 +25,11 @@ struct Args { #[arg(long)] dry_run: bool, + #[arg(long)] + api_key: Option, + + #[arg(long)] + record: Option, } #[derive(Debug, Deserialize)] @@ -60,8 +65,8 @@ fn main() -> Result<()> { } let config = load_config(&args.config)?; - let api_key = config.dreamhost_api_key; - let record = config.dns_record; + let api_key = args.api_key.unwrap_or(config.dreamhost_api_key); + let record = args.record.unwrap_or(config.dns_record); let client = Client::builder() .timeout(std::time::Duration::from_secs(3))