Skip to content

Commit

Permalink
Tweak flag processing
Browse files Browse the repository at this point in the history
To properly retrieve the command.
  • Loading branch information
xllora committed Sep 3, 2017
1 parent b248c07 commit df1f19a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tools/vcli/bw/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,16 @@ func Run(driverName string, drivers map[string]StoreGenerator, chanSize, bulkTri
return 2
}
var args []string
skipFlagValue := false
for _, s := range os.Args {
if strings.HasPrefix(s, "-") {
if !strings.HasPrefix(s, "=") {
skipFlagValue = true
}
continue
}
if skipFlagValue {
skipFlagValue = false
continue
}
args = append(args, s)
Expand Down
2 changes: 2 additions & 0 deletions tools/vcli/bw/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ import (
var (
// drivers contains the registered drivers available for this command line tool.
registeredDrivers map[string]common.StoreGenerator

// Available flags.
driver = flag.String("driver", "VOLATILE", "The storage driver to use {VOLATILE}.")
bqlChannelSize = flag.Int("bql_channel_size", 0, "Internal channel size to use on BQL queries.")
bulkTripleOpSize = flag.Int("bulk_triple_op_size", 1000, "Number of triples to use in bulk load operations.")
bulkTripleBuilderSize = flag.Int("bulk_triple_builder_size_in_bytes", 1000, "Maximum size of literals when parsing a triple.")

// Add your driver flags below.
)

Expand Down

0 comments on commit df1f19a

Please sign in to comment.