1// SPDX-FileCopyrightText: Amolith <amolith@secluded.site>
2//
3// SPDX-License-Identifier: AGPL-3.0-or-later
4
5package completion
6
7import "github.com/spf13/cobra"
8
9// Static returns a completion function that provides fixed values.
10func Static(values ...string) func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective) {
11 vals := append([]string(nil), values...)
12
13 return func(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) {
14 return vals, cobra.ShellCompDirectiveNoFileComp
15 }
16}