diff --git a/README.md b/README.md index 213175f..9e5e10e 100755 --- a/README.md +++ b/README.md @@ -19,7 +19,13 @@ An NCurses-based TUI application for tracking activity over the CAN bus and deco ### Run -`$` `canopen-monitor` +**Run the monitor, binding to `can0`** + +`$` `canopen-monitor -i can0` + +**Use this for an extensive help menu** + +`$` `canopen-monitor --help` *** diff --git a/canopen_monitor/__init__.py b/canopen_monitor/__init__.py index 68e6491..c24b0c0 100755 --- a/canopen_monitor/__init__.py +++ b/canopen_monitor/__init__.py @@ -2,7 +2,7 @@ MAJOR = 3 MINOR = 2 -PATCH = 0 +PATCH = 1 APP_NAME = 'canopen-monitor' APP_DESCRIPTION = 'An NCurses-based TUI application for tracking activity' \ diff --git a/canopen_monitor/__main__.py b/canopen_monitor/__main__.py index b49e03b..659ac7b 100755 --- a/canopen_monitor/__main__.py +++ b/canopen_monitor/__main__.py @@ -1,4 +1,5 @@ import os +import sys import argparse from . import APP_NAME, APP_DESCRIPTION, CONFIG_DIR, CACHE_DIR from .app import App @@ -28,7 +29,7 @@ def main(): dest='interfaces', type=str, nargs='+', - default=['vcan0'], + default=[], help='A list of interfaces to bind to.') parser.add_argument('--no-block', dest='no_block', @@ -40,6 +41,20 @@ def main(): args = parser.parse_args() try: + if(len(args.interfaces) == 0): + print('Warning: no interfaces config was found and you did not' + ' specify any interface arguments') + print(f'\t(see {APP_NAME} -h for details)\n') + print('This means the monitor will not be listening to anything.') + while(True): + answer = input('Would you like to continue anyways? [y/N]: ') + if(answer.upper() == 'N' or answer == ''): + sys.exit(0) + elif(answer.upper() == 'Y'): + break + else: + print(f'Invalid response: {answer}') + init_dirs() eds_configs = load_eds_files() mt = MessageTable(CANOpenParser(eds_configs))