Skip to content

Conversation

thekhalifa
Copy link
Contributor

This is a basic completion for mkdwarfs for the two popular shells. Will be included as part of the debian package, but probably more useful here upstream.

  • Basic completion for common shells for mkdwarfs command.
  • Installed only when WITH_TOOLS=ON and NOT WIN32.
  • Potentially other commands could be added, but mkdwarfs is the most complicated of them.
  • It's not perfect completion and could use some "helpers" from mkdwarfs itself (e.g. list-comp-algos, list-categorizers) to be better at compile-dependent options.

Some common locations to store (doc/completion) and install (CMakeLists.txt) those selected, but happy to move them around or fixup cmake differently. CMake is globbed in 2 dirs to allow future completions to be added/installed as-is.

Also since it's written for debian, I used MIT in there and later realised mkdwarfs is a "writing" application. For the upstream version here, happy to flip that around if you would adopt it.

Copy link
Owner

@mhx mhx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like this! In fact, I was thinking about adding completions for the last release and then abandoned the idea because it seemed too involved.

My main concern is that some of the option arguments can get quite complex, especially those that can be defined per category. But I'm happy to start with something that works well enough to be useful and then improve that over time.

Copy link
Owner

@mhx mhx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Just two minor comments. I'll try to play around with the completions myself in the next few days (I'm currently on vacation).

@mhx
Copy link
Owner

mhx commented Sep 14, 2025

I've been playing with the zsh completions and they look fantastic! :)

- Basic completion for common shells for mkdwarfs command.
- Installed only when WITH_TOOLS=ON and NOT WIN32.
- Potentially other commands could be added, but mkdwarfs is
  the most complicated of them.
- It's not perfect completion and could use some improvements
  to "compression" options that allow a sophisticated syntax
  including category/algo/algo_options.
@thekhalifa
Copy link
Contributor Author

Quick summary:

  • CMakeLists - Set a variable with completion install paths, Zsh defaults to site-functions. Removed extra new line.
  • Zsh completion - changes to promote --man option with description, change how it's disabled, demote -B option to non-described ones, fix '=' consistency on progress and compression.
  • Bash completion - as-is, nothing noteworthy.

@mhx mhx merged commit 7dac1d9 into mhx:main Sep 29, 2025
1 check passed
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