Skip to content

Commit

Permalink
Not perfect but it works
Browse files Browse the repository at this point in the history
  • Loading branch information
saintmalik committed Aug 4, 2022
1 parent e9f79ce commit b7aef09
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
8 changes: 4 additions & 4 deletions cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
// configCmd represents the config command
var configCmd = &cobra.Command{
Use: "config",
Short: "A brief description of your command",
Long: `A longer description that spans multiple lines and likely contains examples.`,
Short: "This command allows you to set DCA Configurations",
Long: `This command allows you to set your Binance API and Secret and other Configurations`,
Run: func(cmd *cobra.Command, args []string) {
setApi, _ := cmd.Flags().GetString("credapi")
if setApi == "reset" {
Expand All @@ -36,7 +36,7 @@ var tpl *template.Template

func init() {
rootCmd.AddCommand(configCmd)
configCmd.PersistentFlags().String("credapi", "", "Set your credentials")
configCmd.PersistentFlags().String("credapi", "reset", "Set your Binance API and SecretKey credentials")
tpl = template.Must(template.ParseGlob("templates/*.html"))
}

Expand Down Expand Up @@ -66,7 +66,7 @@ func creds(w http.ResponseWriter, r *http.Request) {
return
}

fmt.Println(l, "Your Binance API and Secret are set, dont let anyone access this file on your")
fmt.Println(l, "Your Binance API and Secret are set, dont let anyone access this file on your computer")
err = f.Close()
if err != nil {
fmt.Println(err)
Expand Down
10 changes: 4 additions & 6 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@ import (

// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Use: "dca",
Short: "A brief description of your application",
Long: `A longer description that spans multiple lines and likely contains.`,
// Uncomment the following line if your bare application
// has an action associated with it:
// Run: func(cmd *cobra.Command, args []string) { },
Use: "dca-tool",
Short: "Dollar Cost Average Tool",
Long: `This Tool helps purchase the cryptocurrency you've set with your Binance account based on market percentage change.`,
}

// Execute adds all child commands to the root command and sets flags appropriately.
Expand All @@ -30,6 +27,7 @@ func Execute() {
}

func init() {
rootCmd.CompletionOptions.DisableDefaultCmd = true
}


4 changes: 2 additions & 2 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
// runCmd represents the run command
var runCmd = &cobra.Command{
Use: "run",
Short: "A brief description of your command",
Long: `A longer description that.`,
Short: "This command runs the program and execute orders",
Long: `This command runs the program and checks the percentage change of the coin and then purchases the coin if the percentage change is less than the set percentage.`,
Run: func(cmd *cobra.Command, args []string) {
perform()
},
Expand Down

0 comments on commit b7aef09

Please sign in to comment.