Skip to content

Commit 81fc303

Browse files
committed
Rename "dump-completion" to "generate-completion"
1 parent f36a7e8 commit 81fc303

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

CHANGES.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
### New features
66
- Add support for [`!ENV`][mkdocs-env] and [`INHERIT`][mkdocs-inherit] in
77
`mkdocs.yml`
8-
- Add `mike dump-completion` to generate shell-completion functions
8+
- Add `mike generate-completion` to generate shell-completion functions
99

1010
[mkdocs-env]: https://www.mkdocs.org/user-guide/configuration/#environment-variables
1111
[mkdocs-inherit]: https://www.mkdocs.org/user-guide/configuration/#configuration-inheritance

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pip install mike
4141

4242
Once you've installed mike, you might also want to set up shell-completion for
4343
it. If you have [shtab][shtab] installed, you can do this with
44-
`mike dump-completion`, which will print the shell-completion code for your
44+
`mike generate-completion`, which will print the shell-completion code for your
4545
shell. For more details on how to set this up, consult shtab's
4646
[documentation][shtab-setup].
4747

mike/driver.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@
5050
Start the development server, serving pages from the target branch.
5151
"""
5252

53-
dump_completion_desc = """
54-
Print shell-completion functions.
53+
generate_completion_desc = """
54+
Generate shell-completion functions for bfg9000 and write them to standard
55+
output. This requires the Python package `shtab`.
5556
"""
5657

5758

@@ -216,7 +217,7 @@ def help(parser, args):
216217
parser.parse_args(args.subcommand + ['--help'])
217218

218219

219-
def dump_completion(parser, args):
220+
def generate_completion(parser, args):
220221
try:
221222
import shtab
222223
print(shtab.complete(parser, shell=args.shell))
@@ -330,10 +331,10 @@ def main():
330331
help='subcommand to request help for')
331332

332333
completion_p = subparsers.add_parser(
333-
'dump-completion', description=dump_completion_desc,
334+
'generate-completion', description=generate_completion_desc,
334335
help='print shell completion script'
335336
)
336-
completion_p.set_defaults(func=dump_completion)
337+
completion_p.set_defaults(func=generate_completion)
337338
shell = (os.path.basename(os.environ['SHELL'])
338339
if 'SHELL' in os.environ else None)
339340
completion_p.add_argument('-s', '--shell', metavar='SHELL', default=shell,

test/integration/test_command_line.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def test_help_subcommand_extra(self):
1919
self.assertRegex(output, r'^usage: mike deploy')
2020

2121

22-
class DumpCompletionTest(unittest.TestCase):
22+
class GenerateCompletionTest(unittest.TestCase):
2323
def test_completion(self):
24-
output = assertPopen(['mike', 'dump-completion', '-sbash'])
24+
output = assertPopen(['mike', 'generate-completion', '-sbash'])
2525
self.assertRegex(output, r'^#!/usr/bin/env bash')

0 commit comments

Comments
 (0)