mirror of
https://github.com/ChristianLight/tutor.git
synced 2025-02-02 09:28:25 +00:00
Merge remote-tracking branch 'origin/master' into nightly
This commit is contained in:
commit
1890557d40
@ -18,6 +18,7 @@ Every user-facing change should have an entry in this changelog. Please respect
|
||||
|
||||
## Unreleased
|
||||
|
||||
- [Improvement] Auto-complete implicit `local/dev --mount /path/to/...` options. (by @regisb)
|
||||
- 💥[Feature] Strong typing of action and filter hooks: this allows us to detect incorrect calls to `actions.add` or `filters.add` early. Strong typing forces us to break the `do` and `apply` API by removing the `context` named argument. Developers should replace `do(context=...)` by `do_from_context(..., )` (and similar for `apply`).
|
||||
|
||||
## v14.1.2 (2022-11-02)
|
||||
|
@ -4,6 +4,7 @@ import typing as t
|
||||
from copy import deepcopy
|
||||
|
||||
import click
|
||||
from click.shell_completion import CompletionItem
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
from tutor import config as tutor_config
|
||||
@ -172,6 +173,18 @@ class MountParam(click.ParamType):
|
||||
raise self.fail(f"no mount found for {value}")
|
||||
return mounts
|
||||
|
||||
def shell_complete(
|
||||
self, ctx: click.Context, param: click.Parameter, incomplete: str
|
||||
) -> t.List[CompletionItem]:
|
||||
"""
|
||||
Mount argument completion works only for the single path (implicit) form. The
|
||||
reason is that colons break words in bash completion:
|
||||
http://tiswww.case.edu/php/chet/bash/FAQ (E13)
|
||||
Thus, we do not even attempt to auto-complete mount arguments that include
|
||||
colons: such arguments will not even reach this method.
|
||||
"""
|
||||
return [CompletionItem(incomplete, type="file")]
|
||||
|
||||
|
||||
mount_option = click.option(
|
||||
"-m",
|
||||
|
Loading…
x
Reference in New Issue
Block a user