Skip to content
Permalink
Browse files

Fix build errors

* Move version into constant in main.go
* Move usage() func to main.go
  • Loading branch information...
mtchavez committed Mar 18, 2015
1 parent 211fef3 commit 32501085fa7e4f4ae520cda77e6186b90d8046d0
Showing with 23 additions and 31 deletions.
  1. +23 −2 main.go
  2. +0 −24 usage.go
  3. +0 −5 version.go
25 main.go
@@ -11,6 +11,8 @@ import (
"github.com/pearkes/gethub/steps"
)

const versionString = "gethub 0.1.3"

func main() {
// Debugging and version flags
debug := flag.Bool("debug", false, "Logs debugging information to STDOUT.")
@@ -30,12 +32,12 @@ func main() {

// Print the version and exit
if *version {
fmt.Println(versionString())
fmt.Println(versionString)
os.Exit(1)
}

// Log enabled debugging
log.Println("Debugging enabled for", versionString())
log.Println("Debugging enabled for", versionString)

state := new(multistep.BasicStateBag)
state.Put("debug", *debug)
@@ -83,3 +85,22 @@ func authorizeRunner(state multistep.StateBag) {
runner := &multistep.BasicRunner{Steps: steps}
runner.Run(state)
}

// usage prints out the package help
func usage() {
fmt.Println(`Usage: gethub [-v] [-h] [-d] [<path>]
-v, --version Prints the version and exits.
-h, --help Prints the usage information.
-d, --debug Logs debugging information to STDOUT.
Arguments:
path The path to place or update the
repostories. Defaults to the path
in ~/.gethubconfig. This is required
the first time you run gethub.
To learn more or to contribute, please see github.com/pearkes/gethub`)
os.Exit(1)
}

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

0 comments on commit 3250108

Please sign in to comment.
You can’t perform that action at this time.