Add fish shell completions for config subcommand keys
This commit is contained in:
parent
84845af28b
commit
a992e2b12e
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user