rlhelinski / musicbrainz-catalog

Python code for cataloging your music collection cross-referenced with MusicBrainz
GNU General Public License v2.0
2 stars 0 forks source link

Overhaul Shell Command Structure #18

Closed rlhelinski closed 10 years ago

rlhelinski commented 10 years ago

The following is the current command structure.

shellCommands = {
    'simple' : (SimpleFunction, 'simple command help message'),
    ...
}

Instead, we want to be able to also allow commands to have sub-commands, which would provide a nested dictionary of commands rather than a function. Also, the help messages are redundant if the shell functions are properly documented with a docstring referred to by trim(fun.__doc__). Therefore, they need not be represented in this structure. An illustration follows.

shellCommands = {
    'simple' : SimpleFunction,
    'complex' : {'first' : ComplexFirstFunction,
        'second' : ComplexSecondFunction},
    ...
    }