Skip to content

Commit

Permalink
Add basic CLI example
Browse files Browse the repository at this point in the history
  • Loading branch information
timothycrosley committed Mar 19, 2019
1 parent dd3f284 commit e8a45ab
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
Empty file.
17 changes: 17 additions & 0 deletions examples/multi_file_cli/api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import hug

import sub_api


@hug.cli()
def echo(text: hug.types.text):
return text


@hug.extend_api(sub_command='sub_api')
def extend_with():
return (sub_api, )


if __name__ == '__main__':
hug.API(__name__).cli()
6 changes: 6 additions & 0 deletions examples/multi_file_cli/sub_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import hug


@hug.cli()
def hello():
return 'Hello world'

0 comments on commit e8a45ab

Please sign in to comment.