The new cookie-cutter package for dachar will require some thought and moving code around to realise the required command-line interface. I think these might be the required stages:
Move cli.py to dachar/.
Edit setup.py to set the entry point to: dachar=dachar.cli:main
Set up that dachar/cli.py:main() function so that it checks the sub-command (i.e. the first component of the command-line after dachar) before calling other functions in dachar/cli.py.
Those other functions can be:
scan(...)
analyse(...)
write_fixes(...)
Each of those functions should contain only the part of the code that relates to parsing the command-line arguments before actually doing something with them. So, for example, for the scan sub-command, the cli contents should be the parts of dachar/scan/scan.py: _get_arg_parser() and parse_args.
Since this will involve moving content into the dachar/cli.py module from the other modules you will probably need to modify the names of those functions to make them specific to each sub-command.
The key issue here is to separate out the argument-parsing components (which live in dachar/cli.py) from the actual functionality (which live in sub-packages such as scan, analyse etc).
Description
The new cookie-cutter package for dachar will require some thought and moving code around to realise the required command-line interface. I think these might be the required stages:
cli.py
todachar/
.setup.py
to set the entry point to:dachar=dachar.cli:main
dachar/cli.py:main()
function so that it checks the sub-command (i.e. the first component of the command-line afterdachar
) before calling other functions indachar/cli.py
.scan(...)
analyse(...)
write_fixes(...)
scan
sub-command, thecli
contents should be the parts ofdachar/scan/scan.py
:_get_arg_parser()
andparse_args
.dachar/cli.py
module from the other modules you will probably need to modify the names of those functions to make them specific to each sub-command.The key issue here is to separate out the argument-parsing components (which live in
dachar/cli.py
) from the actual functionality (which live in sub-packages such asscan
,analyse
etc).