Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Let "help <term>" fall back to list similar terms#1631

Merged
rolandwalker merged 1 commit intomainfrom
RW/help-keyword-fallback
Feb 27, 2026
Merged

Let "help <term>" fall back to list similar terms#1631
rolandwalker merged 1 commit intomainfrom
RW/help-keyword-fallback

Conversation

@rolandwalker
Copy link
Contributor

@rolandwalker rolandwalker commented Feb 25, 2026

Description

Let help <term> fall back to list similar terms when the term is not found.

  • parameterize the help query
  • no need to pass empty status property
  • search for %keyword% if exact search fails, and report those results as a table of similar terms
  • quote "keyword" in failure message

Example:

last image

Checklist

  • I added this contribution to the changelog.md file.
  • I added my name to the AUTHORS file (or it's already there).
  • To lint and format the code, I ran
    uv run ruff check && uv run ruff format && uv run mypy --install-types .

@rolandwalker rolandwalker self-assigned this Feb 25, 2026
@github-actions
Copy link

Findings

  • cur.execute(query, keyword) and cur.execute(query, f'%{keyword}%') pass a bare string as params. Many DB-API drivers treat a string as an iterable and won’t bind as a single parameter, which can raise or mis-bind depending on the driver. Use single-item tuples instead. mycli/packages/special/main.py:181 and mycli/packages/special/main.py:186.

Missing tests / edge cases

  • Add tests for help <term> fallback behavior: when exact match fails it should return a “Similar terms” table. Also cover quoted/empty keywords (help "") to ensure you don’t accidentally match everything via %%. mycli/packages/special/main.py:178-191.

If you want, I can propose a small patch for the parameter binding and a minimal test.

when the term is not found.

 * parameterize the help query
 * no need to pass empty status property
 * search for %keyword% if exact search fails, and report those results
   as a table of similar terms
 * quote "keyword" in failure message
@rolandwalker rolandwalker force-pushed the RW/help-keyword-fallback branch from 0ea5acd to a839478 Compare February 27, 2026 10:42
@rolandwalker rolandwalker merged commit e99fdf5 into main Feb 27, 2026
8 checks passed
@rolandwalker rolandwalker deleted the RW/help-keyword-fallback branch February 27, 2026 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants