github.com/thanos-io/thanos@v0.32.5/pkg/extflag/hidden.go (about)

     1  // Copyright (c) The Thanos Authors.
     2  // Licensed under the Apache License 2.0.
     3  
     4  package extflag
     5  
     6  import (
     7  	"gopkg.in/alecthomas/kingpin.v2"
     8  )
     9  
    10  type FlagClause interface {
    11  	Flag(name, help string) *kingpin.FlagClause
    12  }
    13  
    14  // HiddenCmdClause returns FlagClause that hides created flags.
    15  func HiddenCmdClause(c FlagClause) FlagClause {
    16  	return hidden{c: c}
    17  }
    18  
    19  type hidden struct {
    20  	c FlagClause
    21  }
    22  
    23  func (h hidden) Flag(name, help string) *kingpin.FlagClause {
    24  	return h.c.Flag(name, help).Hidden()
    25  }