NAME
Developer::Dashboard::CLI::Complete - shell completion candidates for dashboard
SYNOPSIS
use Developer::Dashboard::CLI::Complete;
my @candidates = Developer::Dashboard::CLI::Complete::complete(
words => [ 'dashboard', 'do' ],
index => 1,
);
DESCRIPTION
Builds completion candidates for dashboard subcommands, built-in second-level actions, and dotted skill commands.
PURPOSE
This module centralizes shell-completion candidate generation for dashboard and the d2 shortcut. It exposes top-level built-ins, layered custom commands, dotted installed skill commands, and selected built-in second-level subcommands through one reusable API.
WHY IT EXISTS
It exists because shell completion should not hardcode command lists inside the generated shell snippets. Keeping completion discovery in Perl lets the shell bootstrap ask the live DD-OOP-LAYERS runtime what commands and skills are available.
WHEN TO USE
Use this file when changing shell completion behavior, the exposed subcommand lists, or the interaction between tab completion and installed skills.
HOW TO USE
Call complete(words => \@words, index => $n) with the command-line snapshot the shell provided. The returned list is meant to be printed one entry per line by the private completion helper.
WHAT USES IT
It is used by the private dashboard complete helper, by generated bash and zsh shell bootstraps, and by shell-smoke regression tests that pin the tab completion contract.
EXAMPLES
Example 1:
perl -Ilib -MDeveloper::Dashboard::CLI::Complete -e 'print join qq(\n), Developer::Dashboard::CLI::Complete::complete(words => [qw(dashboard do)], index => 1)'
Preview top-level completion candidates from a source checkout.
Example 2:
perl -Ilib -MDeveloper::Dashboard::CLI::Complete -e 'print join qq(\n), Developer::Dashboard::CLI::Complete::complete(words => [qw(dashboard docker co)], index => 2)'
Preview second-level completion candidates for one built-in command.
Example 3:
prove -lv t/05-cli-smoke.t
Run the focused shell-completion regression tests.
Example 4:
prove -lr t
Recheck completion behavior inside the full repository suite before release.