cmd/input: removed unused option

Signed-off-by: Sam Alba <sam.alba@gmail.com>
This commit is contained in:
Sam Alba 2021-05-18 21:38:21 -07:00
parent 85cc9abb93
commit ef8995b923

View File

@ -10,7 +10,6 @@ import (
"dagger.io/go/cmd/dagger/logger" "dagger.io/go/cmd/dagger/logger"
"dagger.io/go/dagger" "dagger.io/go/dagger"
"cuelang.org/go/cue/ast"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/viper" "github.com/spf13/viper"
) )
@ -69,26 +68,7 @@ var listCmd = &cobra.Command{
fmt.Fprintln(w, "Path\tType") fmt.Fprintln(w, "Path\tType")
for _, val := range inputs { for _, val := range inputs {
// check for references
// this is here because it has issues
// so we wrap it in a flag to control its usage while debugging
_, vals := val.Expr()
if !viper.GetBool("keep-references") {
foundRef := false
for _, ve := range vals {
s := ve.Source()
switch s.(type) {
case *ast.Ident:
foundRef = true
}
}
if foundRef {
continue
}
}
fmt.Fprintf(w, "%s\t%v\n", val.Path(), val) fmt.Fprintf(w, "%s\t%v\n", val.Path(), val)
} }
// ensure we flush the output buf // ensure we flush the output buf
w.Flush() w.Flush()
@ -104,8 +84,6 @@ var listCmd = &cobra.Command{
} }
func init() { func init() {
listCmd.Flags().BoolP("keep-references", "R", false, "Try to eliminate references")
if err := viper.BindPFlags(listCmd.Flags()); err != nil { if err := viper.BindPFlags(listCmd.Flags()); err != nil {
panic(err) panic(err)
} }