// SPDX-FileCopyrightText: Amolith <amolith@secluded.site>
//
// SPDX-License-Identifier: AGPL-3.0-or-later

package completion

import "github.com/spf13/cobra"

// Static returns a completion function that provides fixed values.
func Static(values ...string) func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective) {
	vals := append([]string(nil), values...)

	return func(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective) {
		return vals, cobra.ShellCompDirectiveNoFileComp
	}
}
