Document CLI of panel kitten

This commit is contained in:
Kovid Goyal
2018-06-02 12:24:21 +05:30
parent f857b1afd3
commit 9a615efa83
4 changed files with 48 additions and 4 deletions

View File

@@ -284,6 +284,16 @@ def write_cli_docs():
p('kitty @', func.name + '\n' + '-' * 120)
p('.. program::', 'kitty @', func.name)
p('\n\n' + as_rst(*cli_params_for(func)))
from kittens.runner import all_kitten_names, get_kitten_cli_docs
for kitten in all_kitten_names():
data = get_kitten_cli_docs(kitten)
if data:
with open(f'generated/cli-kitten-{kitten}.rst', 'w') as f:
p = partial(print, file=f)
p('.. program::', f'kitty +kitten {kitten}')
p('\n\n' + option_spec_as_rst(
data['options'], message=data['help_text'], usage=data['usage'], appname=f'kitty +kitten {kitten}',
heading_char='^'))
# }}}

View File

@@ -35,3 +35,9 @@ This will show ``Hello, world.`` at the top edge of your screen for five
seconds. Here the terminal program we are running is ``sh`` with a script to
print out ``Hello, world!``. You can make the terminal program as complex as
you like, as demonstrated in the screenshot above.
Command Line Interface
-------------------------
.. include:: ../generated/cli-kitten-panel.rst