clapcomplete

command module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2025 License: BSD-3-Clause Imports: 9 Imported by: 0

README

Clapcomplete

logo

Build statusReleasesLatest release
LicenseChangelogSoftware metricsGo Report Card
Code lintingCode complexityABC metricsLines of code

clapcomplete is a utility for generating zsh and bash completion configurations for programs using claptrap .

Please file issues in the claptrap todo, and post patches and questions to the claptrap list; please also include #clapcomplete somewhere in your subjects.

About

Clapcomplete takes Claptrap JSON usage data and generates completion scripts for programs. These can then be sourced, after which zsh (or bash) argument completion should be enabled for the command. Clapcomplete will work with any program using Claptrap, without modification to the original program. Zsh and bash are supported. Completions for nested commands are supported.

To use, run the target command with the CLAPTRAP_USAGE_JSON=true environment variable; for example, for the rook program, run:

$ CLAPTRAP_USAGE_JSON=true rook | clapcomplete > rook_completion.sh

Then, source (source rook_completion.sh) and voila -- rook <tab> should show suggestions (if you have completions enabled). To make this persistent, put rook_completion.sh somewhere and source it in your .zshrc.

Bugs and limitations

See the end of CHANGELOG.md for a current list of known issues; you can also check the ticket tracker, although the legume report (in CHANGELOG.md) is probably more comprehensive.

Documentation

Overview

clapcomplete is a bash & zsh completion generation tool for projects using claptrap

Source Files

  • main.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL