Skip to content

Commit

Permalink
Added version command and --version option
Browse files Browse the repository at this point in the history
  • Loading branch information
driusan committed Jan 2, 2016
1 parent 7df5220 commit 530805b
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 11 deletions.
8 changes: 6 additions & 2 deletions BugApplication.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ package main

import (
"fmt"
"github.com/driusan/bug/bugs"
"io/ioutil"
"log"
"os"
"os/exec"
"sort"
"strconv"
//"regex"
"github.com/driusan/bug/bugs"
"strings"
)

Expand Down Expand Up @@ -444,3 +443,8 @@ func (a BugApplication) Relabel(Args []string) {
fmt.Printf("Error moving directory\n")
}
}

func (a BugApplication) Version() {
fmt.Printf("%s version 0.1\n", os.Args[0])

}
11 changes: 11 additions & 0 deletions BugHelp.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,16 @@ Tags can be any string which would make a valid file name.
`This will print a markdown formatted list of all open
issues, grouped by milestone.
`)
case "about":
fallthrough
case "version":
fmt.Printf("Usage: " + os.Args[0] + " version\n\n")
fmt.Printf(
`This will print information about the version of %s being
invoked.
"%s about" is an alias for "version".
`, os.Args[0], os.Args[0])

case "help":
fallthrough
Expand All @@ -210,6 +220,7 @@ issues, grouped by milestone.
fmt.Printf("\tenv\t Show settings that bug will use if invoked from this directory\n")
fmt.Printf("\tpwd\t Prints the issues directory to stdout (useful subcommand in the shell)\n")
fmt.Printf("\troadmap\t Print list of open issues sorted by milestone\n")
fmt.Printf("\tversion\t Print the version of this software\n")
fmt.Printf("\thelp\t Show this screen\n")
}
}
9 changes: 3 additions & 6 deletions Roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@
- More options for bug create

## v0.2:
- Roadmap should indicate status and priority
- Add support for other source control engines
- Better handling of whitespace in issue titles
- Description should be loaded lazily
- Should have git pre-commit hook to automatically regenerate roadmap
- Roadmap sorting should collate better
- Roadmap should indicate status and priority
- Description should be loaded lazily
- Better handling of whitespace in issue titles

## v0.1:
- include version command
2 changes: 0 additions & 2 deletions issues/include-version-command/Description

This file was deleted.

1 change: 0 additions & 1 deletion issues/include-version-command/Milestone

This file was deleted.

Empty file.
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ func main() {
app.Close(os.Args[2:])
case "edit":
app.Edit(os.Args[2:])
case "--version":
fallthrough
case "version":
app.Version()
case "env":
app.Env()
case "dir":
Expand Down

0 comments on commit 530805b

Please sign in to comment.