docs: add usage

This commit is contained in:
Daniel Langbein 2023-06-28 19:51:09 +02:00
parent cebca53cb7
commit 9774045dcf
2 changed files with 25 additions and 2 deletions

View File

@ -22,6 +22,28 @@ For each netcup customer, create a `.json` configuration file inside `/etc/netcu
There is an [example configuration](cfg/example.json).
## Usage
```
usage: netcup-dns [-h] [--config-directory CFG_DIR]
[--cache-directory CACHE_DIR]
[--cache-validity-seconds CACHE_VALIDITY_SECONDS]
Update DNS A/AAAA records with your current external IP address using the
netcup DNS API.
options:
-h, --help show this help message and exit
--config-directory CFG_DIR
Path to directory where `.json` config files reside.
--cache-directory CACHE_DIR
Path to cache directory. Retrieved and updated DNS
records are cached there.
--cache-validity-seconds CACHE_VALIDITY_SECONDS
Value in seconds for how long cached DNS records are
valid. Set to `0` to disable caching.
```
## TODOs
Alternative external IP detection:

View File

@ -57,7 +57,8 @@ def main():
def parse_args():
parser = argparse.ArgumentParser(description='Update DNS A/AAAA records with your current external IP address'
parser = argparse.ArgumentParser(prog='netcup-dns',
description='Update DNS A/AAAA records with your current external IP address'
' using the netcup DNS API.')
parser.add_argument('--config-directory',
help='Path to directory where `.json` config files reside.',
@ -65,7 +66,7 @@ def parse_args():
default=Path('/etc/netcup-dns'),
type=Path)
parser.add_argument('--cache-directory',
help='Path to cache directory. Retrieved/Set DNS records are cached there.',
help='Path to cache directory. Retrieved and updated DNS records are cached there.',
dest='cache_dir',
default=Path.home().joinpath('.netcup-dns/cache'),
type=Path)