1package cmd 2 3import ( 4 "github.com/miguelmota/cointop/cointop" 5 "github.com/spf13/cobra" 6) 7 8// DominanceCmd ... 9func DominanceCmd() *cobra.Command { 10 var apiChoice string 11 var currency string 12 13 dominanceCmd := &cobra.Command{ 14 Use: "dominance", 15 Short: "Displays bitcoin dominance", 16 Long: `The dominance command display the dominance percentage of bitcoin`, 17 RunE: func(cmd *cobra.Command, args []string) error { 18 return cointop.PrintBitcoinDominance(&cointop.DominanceConfig{ 19 Currency: currency, 20 APIChoice: apiChoice, 21 }) 22 }, 23 } 24 25 dominanceCmd.Flags().StringVarP(¤cy, "currency", "f", "USD", "The currency to convert to") 26 dominanceCmd.Flags().StringVarP(&apiChoice, "api", "a", cointop.CoinGecko, "API choice. Available choices are \"coinmarketcap\" and \"coingecko\"") 27 28 return dominanceCmd 29} 30