-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: Add tests for 'commands' option
Signed-off-by: Stephen Finucane <stephen@that.guru>
- Loading branch information
1 parent
1bcd407
commit 37742be
Showing
5 changed files
with
78 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import os | ||
import sys | ||
|
||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) | ||
|
||
extensions = ['sphinx_click'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
"""The greet example taken from the README.""" | ||
|
||
import click | ||
|
||
|
||
@click.group() | ||
def greet(): | ||
"""A sample command group.""" | ||
pass | ||
|
||
|
||
@greet.command() | ||
@click.argument('user', envvar='USER') | ||
def hello(user): | ||
"""Greet a user.""" | ||
click.echo('Hello %s' % user) | ||
|
||
|
||
@greet.command() | ||
def world(): | ||
"""Greet the world.""" | ||
click.echo('Hello world!') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Commands | ||
======== | ||
|
||
.. click:: greet:greet | ||
:prog: greet | ||
:commands: world |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Basics | ||
====== | ||
Nested (full) | ||
============= | ||
|
||
.. click:: greet:greet | ||
:prog: greet | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters