-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
For example:
import clip
def ab(f):
f = clip.opt('-b')(f)
f = clip.arg('a')(f)
return f
app = clip.App()
@app.main()
@clip.opt('-c')
@ab
@clip.opt('-d')
def main(c, a, b, d):
print c, a, b, d
if __name__ == '__main__':
try:
app.run()
except clip.ClipExit:
passThese utility decorators would take a function, add several clip args/opts to it, and return it. One real-world example is a @time decorator that would apply start, end, and duration arguments to a command. Because composability!
Metadata
Metadata
Assignees
Labels
No labels