fastcommand 0.1.7__tar.gz → 0.2.0__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.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: fastcommand
3
- Version: 0.1.7
3
+ Version: 0.2.0
4
4
  Author-email: Jason Morley <hello@jbmorley.co.uk>
5
5
  License: MIT License
6
6
 
@@ -26,9 +26,13 @@ License: MIT License
26
26
 
27
27
  Description-Content-Type: text/markdown
28
28
  License-File: LICENSE
29
+ Requires-Dist: argcomplete
30
+ Dynamic: license-file
29
31
 
30
32
  # fastcommand
31
33
 
34
+ [![build](https://github.com/jbmorley/fastcommand/actions/workflows/build.yaml/badge.svg)](https://github.com/jbmorley/fastcommand/actions/workflows/build.yaml)
35
+
32
36
  Python module for defining multi-command cli programs
33
37
 
34
38
  ## Description
@@ -37,6 +41,8 @@ The `fastcommand` module is a lightweight wrapper over `argparse` which aims to
37
41
 
38
42
  ## Usage
39
43
 
44
+ ### Example
45
+
40
46
  ```python
41
47
  import fastcommand
42
48
 
@@ -65,3 +71,33 @@ def main():
65
71
  if __name__ == "__main__":
66
72
  main()
67
73
  ```
74
+
75
+ ### Autocomplete
76
+
77
+ `fastcommand` provides autocomplete using `argcomplete`. Enable it by adding the following the `argcomplete` marker to the to of your application:
78
+
79
+ ```python
80
+ # PYTHON_ARGCOMPLETE_OK
81
+ ```
82
+
83
+ Install `argcomplete` locally to be able to use autocomplete:
84
+
85
+ ```sh
86
+ pip install argcomplete
87
+ ```
88
+
89
+ And then either:
90
+
91
+ - activate globally by running:
92
+
93
+ ```sh
94
+ activate-global-python-argcomplete
95
+ ```
96
+
97
+ - activate it for a specific command by running:
98
+
99
+ ```sh
100
+ eval "$(register-python-argcomplete my-python-app)"
101
+ ```
102
+
103
+ See the [`argcomplete` documentation](`argcomplete`](https://pypi.org/project/argcomplete/)) for more details.
@@ -1,5 +1,7 @@
1
1
  # fastcommand
2
2
 
3
+ [![build](https://github.com/jbmorley/fastcommand/actions/workflows/build.yaml/badge.svg)](https://github.com/jbmorley/fastcommand/actions/workflows/build.yaml)
4
+
3
5
  Python module for defining multi-command cli programs
4
6
 
5
7
  ## Description
@@ -8,6 +10,8 @@ The `fastcommand` module is a lightweight wrapper over `argparse` which aims to
8
10
 
9
11
  ## Usage
10
12
 
13
+ ### Example
14
+
11
15
  ```python
12
16
  import fastcommand
13
17
 
@@ -36,3 +40,33 @@ def main():
36
40
  if __name__ == "__main__":
37
41
  main()
38
42
  ```
43
+
44
+ ### Autocomplete
45
+
46
+ `fastcommand` provides autocomplete using `argcomplete`. Enable it by adding the following the `argcomplete` marker to the to of your application:
47
+
48
+ ```python
49
+ # PYTHON_ARGCOMPLETE_OK
50
+ ```
51
+
52
+ Install `argcomplete` locally to be able to use autocomplete:
53
+
54
+ ```sh
55
+ pip install argcomplete
56
+ ```
57
+
58
+ And then either:
59
+
60
+ - activate globally by running:
61
+
62
+ ```sh
63
+ activate-global-python-argcomplete
64
+ ```
65
+
66
+ - activate it for a specific command by running:
67
+
68
+ ```sh
69
+ eval "$(register-python-argcomplete my-python-app)"
70
+ ```
71
+
72
+ See the [`argcomplete` documentation](`argcomplete`](https://pypi.org/project/argcomplete/)) for more details.
@@ -25,6 +25,8 @@ import functools
25
25
  import logging
26
26
  import sys
27
27
 
28
+ import argcomplete
29
+
28
30
 
29
31
  COMMANDS = {}
30
32
 
@@ -83,6 +85,7 @@ class CommandParser(object):
83
85
  help="show verbose output")
84
86
 
85
87
  def run(self):
88
+ argcomplete.autocomplete(self.parser)
86
89
  options = self.parser.parse_args()
87
90
  if 'fn' not in options:
88
91
  logging.error("No command specified.")
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: fastcommand
3
- Version: 0.1.7
3
+ Version: 0.2.0
4
4
  Author-email: Jason Morley <hello@jbmorley.co.uk>
5
5
  License: MIT License
6
6
 
@@ -26,9 +26,13 @@ License: MIT License
26
26
 
27
27
  Description-Content-Type: text/markdown
28
28
  License-File: LICENSE
29
+ Requires-Dist: argcomplete
30
+ Dynamic: license-file
29
31
 
30
32
  # fastcommand
31
33
 
34
+ [![build](https://github.com/jbmorley/fastcommand/actions/workflows/build.yaml/badge.svg)](https://github.com/jbmorley/fastcommand/actions/workflows/build.yaml)
35
+
32
36
  Python module for defining multi-command cli programs
33
37
 
34
38
  ## Description
@@ -37,6 +41,8 @@ The `fastcommand` module is a lightweight wrapper over `argparse` which aims to
37
41
 
38
42
  ## Usage
39
43
 
44
+ ### Example
45
+
40
46
  ```python
41
47
  import fastcommand
42
48
 
@@ -65,3 +71,33 @@ def main():
65
71
  if __name__ == "__main__":
66
72
  main()
67
73
  ```
74
+
75
+ ### Autocomplete
76
+
77
+ `fastcommand` provides autocomplete using `argcomplete`. Enable it by adding the following the `argcomplete` marker to the to of your application:
78
+
79
+ ```python
80
+ # PYTHON_ARGCOMPLETE_OK
81
+ ```
82
+
83
+ Install `argcomplete` locally to be able to use autocomplete:
84
+
85
+ ```sh
86
+ pip install argcomplete
87
+ ```
88
+
89
+ And then either:
90
+
91
+ - activate globally by running:
92
+
93
+ ```sh
94
+ activate-global-python-argcomplete
95
+ ```
96
+
97
+ - activate it for a specific command by running:
98
+
99
+ ```sh
100
+ eval "$(register-python-argcomplete my-python-app)"
101
+ ```
102
+
103
+ See the [`argcomplete` documentation](`argcomplete`](https://pypi.org/project/argcomplete/)) for more details.
@@ -7,4 +7,5 @@ fastcommand/main.py
7
7
  fastcommand.egg-info/PKG-INFO
8
8
  fastcommand.egg-info/SOURCES.txt
9
9
  fastcommand.egg-info/dependency_links.txt
10
+ fastcommand.egg-info/requires.txt
10
11
  fastcommand.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ argcomplete
@@ -9,5 +9,5 @@ license = {file = "LICENSE"}
9
9
  authors = [
10
10
  {name = "Jason Morley", email = "hello@jbmorley.co.uk"}
11
11
  ]
12
- dependencies = []
12
+ dependencies = ["argcomplete"]
13
13
  dynamic = ["version"]
File without changes
File without changes
File without changes