ez cliy docs¶
An alternative framework for click or argparse.
Features¶
Model-like decarating of parameters and values
Easy command nesting
Async support
not yet, but i’m planning to add fish and zsh code completion generator
Example¶
from ezcliy import Command, Flag # Import required classes
class SmallTextProcessor(Command):
# Define excpected flags
capitalize = Flag('-c', '--capitalize')
verbose = Flag('--verbose')
def invoke(self): # There put your sweet code
string = ' '.join(self.values)
if self.verbose:
print('Verbose stuff', self.parameters, self.values)
if self.capitalize:
string = string.capitalize()
if not string.endswith('.'):
string += '.'
print(string)
if __name__ == '__main__':
SmallTextProcessor().cli_entry()