RELEASE: Version 1.0 (#3)

This commit is contained in:
2022-06-25 22:27:01 +01:00
committed by GitHub
parent 374d77a2d1
commit e374dc195b
15 changed files with 354 additions and 3 deletions

33
app/args.py Normal file
View File

@ -0,0 +1,33 @@
#!/usr/local/env python3
"""MODULE: Provides CLI arguments to the application."""
import argparse
from app.query_normalisation import get_public_ip
def parse_args() -> argparse.Namespace:
"""Get arguments from user via the command line."""
parser = argparse.ArgumentParser(
description="Query information about an IP address or domain name."
)
parser.add_argument(
"-q",
"--query",
help="IP/domain name to query (default: current public IP)",
default=get_public_ip(),
)
parser.add_argument(
"-p",
"--prefixes",
help="show advertised prefixes",
action="store_true",
)
parser.add_argument(
"-n",
"--noheader",
help="do not print header",
action="store_true",
)
return parser.parse_args()