github.com/sapplications/sb@v0.0.0-20240116135441-1a13cafe3497/cmd/private.go (about)

     1  // Copyright 2022 Vitalii Noha vitalii.noga@gmail.com. All rights reserved.
     2  
     3  package cmd
     4  
     5  import (
     6  	"fmt"
     7  
     8  	"github.com/spf13/cobra"
     9  )
    10  
    11  var subCmds = struct {
    12  	add  string
    13  	del  string
    14  	edit string
    15  	list string
    16  }{
    17  	"add",
    18  	"del",
    19  	"edit",
    20  	"list",
    21  }
    22  
    23  var depFlags struct {
    24  	mod      *string
    25  	item     *string
    26  	dep      *string
    27  	resolver *string
    28  	all      *bool
    29  }
    30  
    31  func init() {
    32  	cobra.EnableCommandSorting = false
    33  }
    34  
    35  func handleError() {
    36  	if r := recover(); r != nil {
    37  		fmt.Printf(ErrorMessageF, r)
    38  	}
    39  }