fastcommand 0.1.8__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.8
3
+ Version: 0.2.0
4
4
  Author-email: Jason Morley <hello@jbmorley.co.uk>
5
5
  License: MIT License
6
6
 
@@ -26,6 +26,8 @@ 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
 
@@ -39,6 +41,8 @@ The `fastcommand` module is a lightweight wrapper over `argparse` which aims to
39
41
 
40
42
  ## Usage
41
43
 
44
+ ### Example
45
+
42
46
  ```python
43
47
  import fastcommand
44
48
 
@@ -67,3 +71,33 @@ def main():
67
71
  if __name__ == "__main__":
68
72
  main()
69
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.
@@ -10,6 +10,8 @@ The `fastcommand` module is a lightweight wrapper over `argparse` which aims to
10
10
 
11
11
  ## Usage
12
12
 
13
+ ### Example
14
+
13
15
  ```python
14
16
  import fastcommand
15
17
 
@@ -38,3 +40,33 @@ def main():
38
40
  if __name__ == "__main__":
39
41
  main()
40
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.8
3
+ Version: 0.2.0
4
4
  Author-email: Jason Morley <hello@jbmorley.co.uk>
5
5
  License: MIT License
6
6
 
@@ -26,6 +26,8 @@ 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
 
@@ -39,6 +41,8 @@ The `fastcommand` module is a lightweight wrapper over `argparse` which aims to
39
41
 
40
42
  ## Usage
41
43
 
44
+ ### Example
45
+
42
46
  ```python
43
47
  import fastcommand
44
48
 
@@ -67,3 +71,33 @@ def main():
67
71
  if __name__ == "__main__":
68
72
  main()
69
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