示例#1
0
class ShowRecord(CommandLine.Application):

    header = 'Tool for displaying BeeDict records'
    synopsis = '%s [options] dictname keys...'
    options = [
        CommandLine.ArgumentOption('-d', 'Display depth', 3),
        CommandLine.SwitchOption('-a', 'Show all records')
    ]

    def check_files(self, files):

        if len(files) < 1:
            self.help('Missing arguments')
            sys.exit(1)

    def main(self):

        show(self.files[0], self.files[1:], self.values['-a'],
             self.values['-d'])