Skip to content

Commit

Permalink
fix: removed version flag and use default one.
Browse files Browse the repository at this point in the history
  • Loading branch information
guipguia committed Aug 10, 2023
1 parent f265aaa commit b7288e6
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 48 deletions.
10 changes: 1 addition & 9 deletions cmd/godl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"fmt"
"os"
"runtime/debug"
"sort"

"github.com/guipguia/godl/internal/commands"
Expand All @@ -21,17 +20,10 @@ func main() {
flags.Filename(),
flags.Directory(),
flags.Concurrency(),
flags.Version(),
flags.Force(),
},
Version: util.VersionNumber,
Action: commands.Run(),
}

if info, ok := debug.ReadBuildInfo(); !ok {
app.Version = "Could not get version information. Please take a look into: https://github.com/guipguia/godl"
} else {
app.Version = info.Main.Version
Action: commands.MainCmd(),
}

sort.Sort(cli.FlagsByName(app.Flags))
Expand Down
2 changes: 1 addition & 1 deletion internal/commands/run.go → internal/commands/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func doForceVerification(f bool, path string) {

// Download is the command function to gether arguments
// so we can start download
func Run() func(ctx *cli.Context) error {
func MainCmd() func(ctx *cli.Context) error {
return func(ctx *cli.Context) error {
doInitialVerifications(ctx)

Expand Down
37 changes: 0 additions & 37 deletions internal/flags/version.go

This file was deleted.

2 changes: 1 addition & 1 deletion internal/util/const.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package util

const VersionNumber = "v0.1.3"
const VersionNumber = "v0.1.4"

0 comments on commit b7288e6

Please sign in to comment.