cli2 2.6.2__tar.gz → 2.6.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cli2-2.6.2/cli2.egg-info → cli2-2.6.4}/PKG-INFO +5 -1
- {cli2-2.6.2 → cli2-2.6.4}/cli2/argument.py +1 -1
- {cli2-2.6.2 → cli2-2.6.4}/cli2/group.py +5 -1
- {cli2-2.6.2 → cli2-2.6.4}/cli2/test_command.py +3 -3
- {cli2-2.6.2 → cli2-2.6.4}/cli2/test_group.py +17 -0
- {cli2-2.6.2 → cli2-2.6.4/cli2.egg-info}/PKG-INFO +5 -1
- {cli2-2.6.2 → cli2-2.6.4}/setup.py +1 -1
- {cli2-2.6.2 → cli2-2.6.4}/MANIFEST.in +0 -0
- {cli2-2.6.2 → cli2-2.6.4}/README.rst +0 -0
- {cli2-2.6.2 → cli2-2.6.4}/classifiers.txt +0 -0
- {cli2-2.6.2 → cli2-2.6.4}/cli2/__init__.py +0 -0
- {cli2-2.6.2 → cli2-2.6.4}/cli2/cli.py +0 -0
- {cli2-2.6.2 → cli2-2.6.4}/cli2/colors.py +0 -0
- {cli2-2.6.2 → cli2-2.6.4}/cli2/command.py +0 -0
- {cli2-2.6.2 → cli2-2.6.4}/cli2/decorators.py +0 -0
- {cli2-2.6.2 → cli2-2.6.4}/cli2/entry_point.py +0 -0
- {cli2-2.6.2 → cli2-2.6.4}/cli2/node.py +0 -0
- {cli2-2.6.2 → cli2-2.6.4}/cli2/table.py +0 -0
- {cli2-2.6.2 → cli2-2.6.4}/cli2/test.py +0 -0
- {cli2-2.6.2 → cli2-2.6.4}/cli2/test_cli.py +0 -0
- {cli2-2.6.2 → cli2-2.6.4}/cli2/test_decorators.py +0 -0
- {cli2-2.6.2 → cli2-2.6.4}/cli2/test_entrypoint.py +0 -0
- {cli2-2.6.2 → cli2-2.6.4}/cli2/test_inject.py +0 -0
- {cli2-2.6.2 → cli2-2.6.4}/cli2/test_node.py +0 -0
- {cli2-2.6.2 → cli2-2.6.4}/cli2/test_table.py +0 -0
- {cli2-2.6.2 → cli2-2.6.4}/cli2.egg-info/SOURCES.txt +0 -0
- {cli2-2.6.2 → cli2-2.6.4}/cli2.egg-info/dependency_links.txt +0 -0
- {cli2-2.6.2 → cli2-2.6.4}/cli2.egg-info/entry_points.txt +0 -0
- {cli2-2.6.2 → cli2-2.6.4}/cli2.egg-info/requires.txt +0 -0
- {cli2-2.6.2 → cli2-2.6.4}/cli2.egg-info/top_level.txt +0 -0
- {cli2-2.6.2 → cli2-2.6.4}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cli2
|
|
3
|
-
Version: 2.6.
|
|
3
|
+
Version: 2.6.4
|
|
4
4
|
Summary: image:: https://yourlabs.io/oss/cli2/badges/master/pipeline.svg
|
|
5
5
|
Home-page: https://yourlabs.io/oss/cli2
|
|
6
6
|
Author: James Pic
|
|
@@ -9,7 +9,11 @@ License: MIT
|
|
|
9
9
|
Keywords: cli
|
|
10
10
|
Requires-Python: >=3.6
|
|
11
11
|
Description-Content-Type: text/x-rst
|
|
12
|
+
Requires-Dist: docstring_parser==0.7.1
|
|
12
13
|
Provides-Extra: test
|
|
14
|
+
Requires-Dist: freezegun; extra == "test"
|
|
15
|
+
Requires-Dist: pytest; extra == "test"
|
|
16
|
+
Requires-Dist: pytest-cov; extra == "test"
|
|
13
17
|
|
|
14
18
|
.. image:: https://yourlabs.io/oss/cli2/badges/master/pipeline.svg
|
|
15
19
|
:target: https://yourlabs.io/oss/cli2/pipelines
|
|
@@ -285,7 +285,7 @@ class Argument:
|
|
|
285
285
|
|
|
286
286
|
def aliasmatch(self, arg):
|
|
287
287
|
"""Return True if the CLI arg matches an alias of this argument."""
|
|
288
|
-
if arg
|
|
288
|
+
if arg in self.negates:
|
|
289
289
|
return True
|
|
290
290
|
if self.iskw and self.param.annotation == bool and arg in self.alias:
|
|
291
291
|
return True
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import inspect
|
|
2
|
+
import textwrap
|
|
2
3
|
|
|
3
4
|
from .colors import colors
|
|
4
5
|
from .command import Command
|
|
@@ -13,7 +14,10 @@ class Group(EntryPoint, dict):
|
|
|
13
14
|
def __init__(self, name=None, doc=None, color=None, posix=False,
|
|
14
15
|
outfile=None, cmdclass=None, log=True):
|
|
15
16
|
self.name = name
|
|
16
|
-
|
|
17
|
+
if doc:
|
|
18
|
+
self.doc = textwrap.dedent(doc).strip()
|
|
19
|
+
else:
|
|
20
|
+
self.doc = inspect.getdoc(self)
|
|
17
21
|
self.color = color or colors.green
|
|
18
22
|
self.posix = posix
|
|
19
23
|
self.parent = None
|
|
@@ -141,12 +141,12 @@ def test_bool_flag():
|
|
|
141
141
|
|
|
142
142
|
|
|
143
143
|
def test_bool_flag_posix():
|
|
144
|
-
def foo(hi: bool = None): return hi
|
|
144
|
+
def foo(fuzz=None, hi: bool = None): return hi
|
|
145
145
|
cmd = Command(foo, posix=True)
|
|
146
|
+
assert cmd('-nh') is False
|
|
147
|
+
assert cmd('--no-hi') is False
|
|
146
148
|
assert cmd('--hi') is True
|
|
147
149
|
assert cmd('-h') is True
|
|
148
|
-
assert cmd('--no-hi') is False
|
|
149
|
-
assert cmd('-nh') is False
|
|
150
150
|
|
|
151
151
|
|
|
152
152
|
def test_bool_flag_negate():
|
|
@@ -54,6 +54,23 @@ def test_help():
|
|
|
54
54
|
group('help', 'lol')
|
|
55
55
|
assert 'not found' in group.outfile
|
|
56
56
|
|
|
57
|
+
group.group(
|
|
58
|
+
"test",
|
|
59
|
+
doc="""
|
|
60
|
+
Le Lorem Ipsum est simplement du faux texte employé dans la composition
|
|
61
|
+
et la mise en page avant impression. Le Lorem Ipsum est le faux texte
|
|
62
|
+
|
|
63
|
+
standard de l'imprimerie depuis les années 1500, quand un imprimeur
|
|
64
|
+
anonyme assembla ensemble des morceaux de texte pour réaliser un livre
|
|
65
|
+
applications de mise en page de texte, comme Aldus PageMaker.
|
|
66
|
+
"""
|
|
67
|
+
)
|
|
68
|
+
group.outfile.reset()
|
|
69
|
+
group('help')
|
|
70
|
+
assert group.outfile.out.endswith("avant impression\n")
|
|
71
|
+
group.outfile.reset()
|
|
72
|
+
group('help', 'test')
|
|
73
|
+
|
|
57
74
|
|
|
58
75
|
def test_help_nested():
|
|
59
76
|
def c(): 'cdoc'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cli2
|
|
3
|
-
Version: 2.6.
|
|
3
|
+
Version: 2.6.4
|
|
4
4
|
Summary: image:: https://yourlabs.io/oss/cli2/badges/master/pipeline.svg
|
|
5
5
|
Home-page: https://yourlabs.io/oss/cli2
|
|
6
6
|
Author: James Pic
|
|
@@ -9,7 +9,11 @@ License: MIT
|
|
|
9
9
|
Keywords: cli
|
|
10
10
|
Requires-Python: >=3.6
|
|
11
11
|
Description-Content-Type: text/x-rst
|
|
12
|
+
Requires-Dist: docstring_parser==0.7.1
|
|
12
13
|
Provides-Extra: test
|
|
14
|
+
Requires-Dist: freezegun; extra == "test"
|
|
15
|
+
Requires-Dist: pytest; extra == "test"
|
|
16
|
+
Requires-Dist: pytest-cov; extra == "test"
|
|
13
17
|
|
|
14
18
|
.. image:: https://yourlabs.io/oss/cli2/badges/master/pipeline.svg
|
|
15
19
|
:target: https://yourlabs.io/oss/cli2/pipelines
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|