friend1ws / nanomonsv

SV detection tool for nanopore sequence reads
GNU General Public License v3.0
78 stars 12 forks source link

Exit with help if no command line arguments. #33

Closed kojix2 closed 1 year ago

kojix2 commented 1 year ago

Hi @friend1ws and nanomonsv contributors.

I recently had the opportunity to run nanomonsv on long-read sequence data and found something I could contribute to its usability.

Actual behavior

If you run the nanomonsv command with no arguments, you will receive the following error:

nanomonsv
Traceback (most recent call last):
  File "/home/kojix2/miniconda3/envs/nanomonsv_dev/bin/nanomonsv", line 33, in <module>
    sys.exit(load_entry_point('nanomonsv==0.5.1b0', 'console_scripts', 'nanomonsv')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/kojix2/miniconda3/envs/nanomonsv_dev/lib/python3.11/site-packages/nanomonsv-0.5.1b0-py3.11.egg/nanomonsv/__init__.py", line 9, in main
AttributeError: 'Namespace' object has no attribute 'func'

Expected behavior

Generally, when a command is executed with no arguments, the expected behavior is to print "help" to the standard error output and exit abnormally. For example, minimap2 works that way.

minimap2        # Output help to STDERR
echo $?         # 1
minimap2 --help # Output help to STDOUT
echo $?         # 0

I am not very familiar with Python practices, so if there are any corrections that need to be made, please feel free to overwrite this commit with additional commits.

Thank you.

friend1ws commented 1 year ago

Thanks!