aboutsummaryrefslogtreecommitdiffstats
path: root/bommom.go
diff options
context:
space:
mode:
authorbnewbold <bnewbold@robocracy.org>2012-04-18 23:15:23 -0400
committerbnewbold <bnewbold@robocracy.org>2012-04-18 23:15:23 -0400
commitc40296d848abd8a7478dece2169cab97d5196dfd (patch)
tree724777d58056dacdf8217f0d9ab6831518c287e0 /bommom.go
parent9c034ab99f8632db38a6c205b848137ebb506d28 (diff)
downloadbommom-c40296d848abd8a7478dece2169cab97d5196dfd.zip
bommom-c40296d848abd8a7478dece2169cab97d5196dfd.tar.gz
remove variable arg length load for simplicity
Diffstat (limited to 'bommom.go')
-rw-r--r--bommom.go20
1 files changed, 7 insertions, 13 deletions
diff --git a/bommom.go b/bommom.go
index 1feab62..2573300 100644
--- a/bommom.go
+++ b/bommom.go
@@ -210,20 +210,15 @@ func dumpCmd() {
}
func loadCmd() {
+ if flag.NArg() != 5 {
+ log.Fatal("Error: wrong number of arguments (expected input file, username, bomname)")
+ }
var userName, bomName, version string
- if flag.NArg() == 4 {
- userName = anonUser.name
- bomName = flag.Arg(2)
- version = flag.Arg(3)
- } else if flag.NArg() == 5 {
- userName = flag.Arg(2)
- bomName = flag.Arg(3)
- version = flag.Arg(4)
- } else {
- log.Fatal("Error: wrong number of arguments (expected input file, optional username, bomname)")
- }
inFname := flag.Arg(1)
+ userName = flag.Arg(2)
+ bomName = flag.Arg(3)
+ version = flag.Arg(4)
if !(isShortName(userName) && isShortName(bomName) && isShortName(version)) {
log.Fatal("user, name, and version must be ShortNames")
@@ -295,7 +290,6 @@ func listCmd() {
}
} else {
// list all boms from all names
- // TODO: ERROR
bomStubs, err = bomstore.ListBoms("")
if err != nil {
log.Fatal(err)
@@ -316,7 +310,7 @@ func printUsage() {
fmt.Println("")
fmt.Println("\tinit \t\t initialize BOM and authentication datastores")
fmt.Println("\tlist [user]\t\t list BOMs, optionally filtered by user")
- fmt.Println("\tload <file.type> [user] <bom_name> <version>\t import a BOM")
+ fmt.Println("\tload <file.type> <user> <bom_name> <version>\t import a BOM")
fmt.Println("\tdump <user> <name> [file.type]\t dump a BOM to stdout")
fmt.Println("\tconvert <infile.type> <outfile.type>\t convert a BOM file")
fmt.Println("\tserve\t\t serve up web interface over HTTP")