forked from clueboard/milc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hello
executable file
·20 lines (15 loc) · 638 Bytes
/
hello
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env python3
"""Hello World implementation using MILC.
PYTHON_ARGCOMPLETE_OK
"""
from milc import cli
@cli.argument('-c', '--comma', arg_only=True, help='comma in output', default=True, action='store_boolean')
@cli.argument('-n', '--name', help='Name to greet', default='World')
@cli.entrypoint('Greet a user.')
def main(cli):
comma = ',' if cli.args.comma else ''
cli.log.debug('You used -v you lucky person!')
cli.log.info('Hello%s %s, from cli.log.info!', comma, cli.config.general.name)
cli.echo('{fg_red}Hello%s %s, from cli.echo!', comma, cli.config.general.name)
if __name__ == '__main__':
cli()