2020-08-11 06:12:56 +00:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/miguelmota/cointop/cointop"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
// DominanceCmd ...
|
|
|
|
func DominanceCmd() *cobra.Command {
|
2020-08-22 05:27:40 +00:00
|
|
|
var apiChoice string
|
|
|
|
var currency string
|
2020-08-11 06:12:56 +00:00
|
|
|
|
|
|
|
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(¤cy, "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
|
|
|
|
}
|