github.com/taubyte/tau-cli@v0.1.13-0.20240326000942-487f0d57edfc/cli/common/flags.go (about)

     1  package common
     2  
     3  import (
     4  	"github.com/urfave/cli/v2"
     5  )
     6  
     7  type flagHandler struct {
     8  	linker *linker
     9  }
    10  
    11  func (l *linker) Flags() FlagHandler {
    12  	return flagHandler{l}
    13  }
    14  
    15  // Shift will add a flag to the start of the flag chain
    16  func (h flagHandler) Shift(flags ...cli.Flag) {
    17  	h.linker.Raw().Flags = append(flags, h.linker.Raw().Flags...)
    18  }
    19  
    20  // Push will add a flag to the end of the flag chain.
    21  func (h flagHandler) Push(flags ...cli.Flag) {
    22  	h.linker.Raw().Flags = append(h.linker.Raw().Flags, flags...)
    23  }