File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,21 +19,25 @@ Usage: dreamhost-ddns.exe [OPTIONS]
1919
2020Options:
2121 -v, --verbose
22- -c, --config <CONFIG> [default: config.toml]
22+ -c, --config <CONFIG> [default: config.toml]
2323 --dry-run
24- -h, --help Print help
25- -V, --version Print version
24+ --api-key <API_KEY>
25+ --record <RECORD>
26+ -h, --help Print help
27+ -V, --version Print version
2628```
2729### Linux / Others
2830```
29- Usage: dreamhost-ddns [OPTIONS]
31+ Usage: dreamhost-ddns.exe [OPTIONS]
3032
3133Options:
3234 -v, --verbose
33- -c, --config <CONFIG> [default: config.toml]
35+ -c, --config <CONFIG> [default: config.toml]
3436 --dry-run
35- -h, --help Print help
36- -V, --version Print version
37+ --api-key <API_KEY>
38+ --record <RECORD>
39+ -h, --help Print help
40+ -V, --version Print version
3741```
3842You will likely need to make the dreamhost-ddns file executable first:
3943``` bash
Original file line number Diff line number Diff line change @@ -25,6 +25,11 @@ struct Args {
2525 #[ arg( long) ]
2626 dry_run : bool ,
2727
28+ #[ arg( long) ]
29+ api_key : Option < String > ,
30+
31+ #[ arg( long) ]
32+ record : Option < String > ,
2833}
2934
3035#[ derive( Debug , Deserialize ) ]
@@ -60,8 +65,8 @@ fn main() -> Result<()> {
6065 }
6166
6267 let config = load_config ( & args. config ) ?;
63- let api_key = config. dreamhost_api_key ;
64- let record = config. dns_record ;
68+ let api_key = args . api_key . unwrap_or ( config. dreamhost_api_key ) ;
69+ let record = args . record . unwrap_or ( config. dns_record ) ;
6570
6671 let client = Client :: builder ( )
6772 . timeout ( std:: time:: Duration :: from_secs ( 3 ) )
You can’t perform that action at this time.
0 commit comments