2
0
mirror of https://github.com/miguelmota/cointop synced 2024-11-10 13:10:26 +00:00
cointop/cmd/commands/dominance.go
2020-11-18 20:37:40 -08:00

30 lines
824 B
Go

package cmd
import (
"github.com/miguelmota/cointop/cointop"
"github.com/spf13/cobra"
)
// DominanceCmd ...
func DominanceCmd() *cobra.Command {
var apiChoice string
var currency string
dominanceCmd := &cobra.Command{
Use: "dominance",
Short: "Displays bitcoin dominance",
Long: `The dominance command display the dominance percentage of bitcoin`,
RunE: func(cmd *cobra.Command, args []string) error {
return cointop.PrintBitcoinDominance(&cointop.DominanceConfig{
Currency: currency,
APIChoice: apiChoice,
})
},
}
dominanceCmd.Flags().StringVarP(&currency, "currency", "f", "USD", "The currency to convert to")
dominanceCmd.Flags().StringVarP(&apiChoice, "api", "a", cointop.CoinGecko, "API choice. Available choices are \"coinmarketcap\" and \"coingecko\"")
return dominanceCmd
}