riptano / ccm

A script to easily create and destroy an Apache Cassandra cluster on localhost
Apache License 2.0
1.22k stars 303 forks source link

Refactor Cmd subclasses and ccm #627

Closed muru closed 7 years ago

muru commented 7 years ago

While looking into #258 (use of argparse instead of optparse*), I noticed that:

This left much of the get_parser() and description() methods repetitive. By moving ignore_unknown_options to a field as well, I could eliminate all definitions of get_parser and description in favour of methods in the parent Cmd class.

By renaming the cluster_cmds() and node_cmds() functions, I could also do some DRY refactoring in the main ccm script, so there's that as well.

Finally, I added some empty lines here and there to stop flake8 complaining about PEP8 guidelines (2 blank lines after class/function definitions).

Thoughts?


* You can see the WIP state of that here.