mirror of
https://github.com/kennethreitz-archive/plac.git
synced 2026-06-05 15:40:17 +00:00
28 lines
670 B
Python
28 lines
670 B
Python
import plac
|
|
|
|
class FVCS(object):
|
|
"A Fake Version Control System"
|
|
commands = 'checkout', 'commit', 'status', 'help'
|
|
|
|
@plac.annotations(
|
|
name=('a recognized command', 'positional', None, str, commands))
|
|
def help(self, name):
|
|
print(plac.parser_from(self).help_cmd(name))
|
|
|
|
@plac.annotations(
|
|
url=('url of the source code', 'positional'))
|
|
def checkout(self, url):
|
|
print('checkout', url)
|
|
|
|
def commit(self):
|
|
print('commit')
|
|
|
|
@plac.annotations(quiet=('summary information', 'flag'))
|
|
def status(self, quiet):
|
|
print('status', quiet)
|
|
|
|
main = FVCS()
|
|
|
|
if __name__ == '__main__':
|
|
plac.call(main)
|