Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prefix isn't honored in some places #17

Open
2 tasks
evgfilim1 opened this issue Sep 23, 2022 · 0 comments
Open
2 tasks

prefix isn't honored in some places #17

evgfilim1 opened this issue Sep 23, 2022 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@evgfilim1
Copy link
Owner

evgfilim1 commented Sep 23, 2022

  • When looking for .help command:
    if args := command.args:
    for h in self._handlers:
    for cmd in h.commands:
    match cmd:
    case re.Pattern() as pattern:
    matches = pattern.fullmatch(args) is not None
    case str():
    matches = cmd == args
    case _:
    raise AssertionError(f"Unexpected command type: {type(cmd)}")
    if matches:
    usage = h.format_usage(full=True)
    return _("<b>Help for {args}:</b>\n{usage}").format(
    args=html.escape(args),
    usage=html.escape(usage),
    )
  • When checking command conflicts while registering:
    for handler in self._handlers:
    for cmd in handler.commands:
    if cmd in commands:
    raise ValueError(f"Duplicate command: {cmd}")
@evgfilim1 evgfilim1 added bug Something isn't working good first issue Good for newcomers labels Sep 23, 2022
@evgfilim1 evgfilim1 changed the title Take prefix into account in some places prefix isn't honored in some places Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant