From a992e2b12ecfab0b5a64f82affe10940f9c16105 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Fri, 20 Mar 2026 11:12:45 -0700 Subject: [PATCH] Add fish shell completions for config subcommand keys --- src/commands/completions.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/commands/completions.ts b/src/commands/completions.ts index 54a144f..ad35d72 100644 --- a/src/commands/completions.ts +++ b/src/commands/completions.ts @@ -1,4 +1,5 @@ import type { Command, Option } from "commander" +import { DEFAULTS } from "../config.ts" /** Generate fish completion lines from the Commander program tree. */ export function generateFishCompletions(program: Command): string[] { @@ -51,6 +52,13 @@ export function generateFishCompletions(program: Command): string[] { lines.push(`complete -c sandlot -n "__fish_seen_subcommand_from ${branchCommands.join(" ")}" -xa "(__sandlot_sessions)"`) } + // Config key completions + const configKeys = Object.keys(DEFAULTS) + if (configKeys.length > 0) { + lines.push("") + lines.push(`complete -c sandlot -n "__fish_seen_subcommand_from config" -xa "${configKeys.join(" ")}"`) + } + lines.push("") return lines }