Skip to content

Add fish shell completion - #69

Open
montionugera wants to merge 1 commit into
devdavidejesus:mainfrom
montionugera:feat/issue-62-fish-completion
Open

montionugera wants to merge 1 commit into
devdavidejesus:mainfrom
montionugera:feat/issue-62-fish-completion

Conversation

@montionugera

Copy link
Copy Markdown

What and why

Adds static fish shell completions (completions/btc-toolkit.fish) mirroring completions/btc-toolkit.zsh for all 11 subcommands and their supported flags, extends tests/test_completions.py to ensure fish completions stay synchronized with build_parser(), and documents fish completion in README.md and CHANGELOG.md.

Closes #62

Checklist

  • Standard library only: no new runtime dependency
  • Tests added or updated in tests/ (unittest, API calls mocked, runs offline)
  • python -m coverage run -m unittest discover -s tests -t . then python -m coverage report (90% or more)
  • ruff check btc_toolkit/ tests/ fuzz/ .github/scripts/ and mypy --strict btc_toolkit/ pass
  • A new parser of untrusted data has a fuzz target in fuzz/fuzz_parsers.py
  • --json keys only added, never renamed or removed (docs/json-schema.md)
  • Every txid, address or on-chain fact in docs or tests can be checked against the chain
  • A user-visible change has a line under [Unreleased] in CHANGELOG.md

- Add completions/btc-toolkit.fish with subcommands and flags mirroring btc-toolkit.zsh
- Extend tests/test_completions.py to ensure fish completions match build_parser()
- Mention fish in README.md shell completion docs and architecture overview
- Update CHANGELOG.md under [Unreleased]

Closes devdavidejesus#62
@devdavidejesus

Copy link
Copy Markdown
Owner

Thanks a lot for this, and welcome! It's the project's first outside contribution.

I tested it in a real fish shell (3.7.0): all 11 commands, their flags and the networks complete correctly, and the tests pass. Two small changes before I merge:

  1. -r lets fish suggest file names for the option's value. That fits --file, but not the options that take a value, where it now lists the current directory (bash and zsh complete nothing there). Could you use -x for these four?

    -l api-url -x
    -l timeout -x
    -l limit -x
    -l txid -x
    
  2. The Homebrew formula only installs the bash and zsh scripts for now, so in the README please keep that sentence true, e.g.: "The Homebrew formula installs the bash and zsh ones for you." I'll add fish to the formula with the next release.

Then I'll merge.

This branch has not been deployed

No deployments
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.

Add fish shell completion

2 participants