Skip to content

Commit

Permalink
feat: add version
Browse files Browse the repository at this point in the history
  • Loading branch information
hanksudo committed Sep 10, 2022
1 parent 3388217 commit ca9cb2a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"flag"
"fmt"
"os"

"github.com/hanksudo/bot-currency/backup"
Expand All @@ -10,18 +11,24 @@ import (
"github.com/robfig/cron/v3"
)

const version = "0.0.1"

// RootPath - root of project
var RootPath string

func main() {
RootPath, _ = os.Getwd()

versionPtr := flag.Bool("version", false, "Print the version")
webPtr := flag.Bool("web", false, "Start web server")
renewPtr := flag.Bool("renew", false, "Renew currency data")
backupPtr := flag.Bool("backup", false, "Backup to Dropbox")
flag.Parse()

if len(os.Args) == 1 {
flag.PrintDefaults()
} else if *versionPtr {
fmt.Printf("%s", version)
} else if *webPtr {
c := cron.New()
// Renew - Every one hour on weekday
Expand Down

0 comments on commit ca9cb2a

Please sign in to comment.