Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,25 @@ Usage: dreamhost-ddns.exe [OPTIONS]

Options:
-v, --verbose
-c, --config <CONFIG> [default: config.toml]
-c, --config <CONFIG> [default: config.toml]
--dry-run
-h, --help Print help
-V, --version Print version
--api-key <API_KEY>
--record <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 <CONFIG> [default: config.toml]
-c, --config <CONFIG> [default: config.toml]
--dry-run
-h, --help Print help
-V, --version Print version
--api-key <API_KEY>
--record <RECORD>
-h, --help Print help
-V, --version Print version
```
You will likely need to make the dreamhost-ddns file executable first:
```bash
Expand Down
Binary file modified binaries/linux-aarch64/dreamhost-ddns
Binary file not shown.
Binary file modified binaries/linux-rpi-armv7/dreamhost-ddns
Binary file not shown.
Binary file modified binaries/linux-x86_64/dreamhost-ddns
Binary file not shown.
Binary file modified binaries/windows/dreamhost-ddns.exe
Binary file not shown.
9 changes: 7 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ struct Args {
#[arg(long)]
dry_run: bool,

#[arg(long)]
api_key: Option<String>,

#[arg(long)]
record: Option<String>,
}

#[derive(Debug, Deserialize)]
Expand Down Expand Up @@ -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))
Expand Down