diff --git a/README.md b/README.md index 303a250..e6a3304 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,8 @@ usage: nrx [-h] [-v] [-d] [-I [VERSION]] [-c CONFIG] [-i INPUT] [-o OUTPUT] [-a nrx - network topology exporter by netreplica +online documentation: https://github.com/netreplica/nrx/blob/main/README.md + optional arguments: -h, --help show this help message and exit -v, --version show version number and exit @@ -162,6 +164,9 @@ optional arguments: -T, --templates TEMPLATES directory with template files, will be prepended to TEMPLATES_PATH list in the configuration file -M, --map MAP file with platform mappings to node parameters (default: platform_map.yaml in templates folder) -D, --dir DIR save files into directory DIR (topology name is used by default). nested relative and absolute paths are OK + +To pass authentication token, use configuration file or environment variable: +export NB_API_TOKEN='replace_with_valid_API_token' ``` Note: for security reasons, there is no argument to pass an API token. Use either an environmental variable or a configuration file. diff --git a/src/nrx/__about__.py b/src/nrx/__about__.py index 03a523b..bb416cc 100644 --- a/src/nrx/__about__.py +++ b/src/nrx/__about__.py @@ -19,4 +19,4 @@ """ Metadata for the nrx package """ -__version__ = "0.5.0rc1" +__version__ = "0.5.0rc2" diff --git a/src/nrx/nrx.py b/src/nrx/nrx.py index b9c8c62..caf886b 100755 --- a/src/nrx/nrx.py +++ b/src/nrx/nrx.py @@ -26,14 +26,17 @@ It can also read the topology graph previously saved as a CYJS file to convert it into the one of supported network emulation formats. """ - +# Standard library imports import os import sys import argparse +from argparse import RawDescriptionHelpFormatter import json import math import ast +import textwrap import zipfile +# Third-party library imports import toml import pynetbox import requests @@ -983,7 +986,15 @@ def arg_input_check(s): def parse_args(): """CLI arguments parser""" - args_parser = argparse.ArgumentParser(prog='nrx', description="nrx - network topology exporter by netreplica") + args_parser = argparse.ArgumentParser(prog='nrx', + formatter_class=RawDescriptionHelpFormatter, + description=textwrap.dedent(""" + nrx - network topology exporter by netreplica + + online documentation: https://github.com/netreplica/nrx/blob/main/README.md"""), + epilog=textwrap.dedent(""" + To pass authentication token, use configuration file or environment variable: + export NB_API_TOKEN='replace_with_valid_API_token'""")) sites_group = args_parser.add_mutually_exclusive_group()