mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00

* feat: add index to sqlite-history table * feat: support style argument to RichCompletion object this will enable setting style for ptk completers * feat: add xonsh cli/argparser utils * feat: add python api for adding/removing completers fixes #3972 * fix: mypy error * docs: add api doc * fix: circular imports * docs: * fix: testing get-doc cross-platform * Update xonsh/completers/_aliases.py Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com> * Update xonsh/completers/_aliases.py Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com> * style: convert % to f-strings Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com> Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
35 lines
698 B
Python
35 lines
698 B
Python
"""Test module xonsh/cli_utils.py"""
|
|
from xonsh import cli_utils
|
|
|
|
|
|
def func_with_doc(param: str, multi: str) -> str:
|
|
"""func doc
|
|
multi-line
|
|
|
|
Parameters
|
|
----------
|
|
param
|
|
param doc
|
|
multi
|
|
param doc
|
|
multi line
|
|
Returns
|
|
-------
|
|
str
|
|
return doc
|
|
"""
|
|
return param + multi
|
|
|
|
|
|
def test_get_doc_param():
|
|
assert cli_utils.get_doc(func_with_doc).splitlines() == [
|
|
"func doc",
|
|
"multi-line",
|
|
]
|
|
assert cli_utils.get_doc(func_with_doc, "param").splitlines() == [
|
|
"param doc",
|
|
]
|
|
assert cli_utils.get_doc(func_with_doc, "multi").splitlines() == [
|
|
"param doc",
|
|
" multi line",
|
|
]
|