diff --git a/cmd/fig/fig.go b/cmd/fig/fig.go new file mode 100644 index 00000000000..cc5eead4f15 --- /dev/null +++ b/cmd/fig/fig.go @@ -0,0 +1,27 @@ +// Copyright 2022 The Sigstore Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package main + +import ( + "fmt" + + "github.com/sigstore/cosign/cmd/cosign/cli" + genFigSpec "github.com/withfig/autocomplete-tools/packages/cobra" +) + +func main() { + spec := genFigSpec.MakeFigSpec(cli.New()) + fmt.Println(spec.ToTypescript()) +} diff --git a/go.mod b/go.mod index 6c27cdfe5fa..7bcfc905785 100644 --- a/go.mod +++ b/go.mod @@ -54,6 +54,7 @@ require ( github.com/mattn/go-runewidth v0.0.13 // indirect github.com/prometheus/procfs v0.7.3 // indirect github.com/urfave/cli v1.22.5 // indirect + github.com/withfig/autocomplete-tools/packages/cobra v0.0.0-20220122124547-31d3821a6898 go.opentelemetry.io/contrib v1.3.0 // indirect go.opentelemetry.io/proto/otlp v0.12.0 // indirect k8s.io/kube-openapi v0.0.0-20220124234850-424119656bbf // indirect diff --git a/go.sum b/go.sum index 87022be8bdc..bf47ba8cc3e 100644 --- a/go.sum +++ b/go.sum @@ -2063,6 +2063,8 @@ github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17 github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= github.com/willf/bitset v1.1.11-0.20200630133818-d5bec3311243/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI= +github.com/withfig/autocomplete-tools/packages/cobra v0.0.0-20220122124547-31d3821a6898 h1:2Z+iziYPiyWk5hVJ3EYLn/i33Tj5ukytaJA0Th9tbgc= +github.com/withfig/autocomplete-tools/packages/cobra v0.0.0-20220122124547-31d3821a6898/go.mod h1:cKObXQ6PVFO7bHUd5jpApXvMIt55Ewz7UdMiC05ONxI= github.com/xanzy/go-gitlab v0.31.0/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug= github.com/xanzy/go-gitlab v0.54.4 h1:3CFEdQ9O+bFx3BsyuOK0gqgLPwnT2rwnPOjudV07wTw= github.com/xanzy/go-gitlab v0.54.4/go.mod h1:F0QEXwmqiBUxCgJm8fE9S+1veX4XC9Z4cfaAbqwk4YM=