Skip to content

Commit d5ee0e5

Browse files
committed
cli: typos and other fixes
Fixed documentation, typos and erroneous messages. Also library URL parameters are converted to lowercase before parsing. Signed-off-by: Javi Fontan <[email protected]>
1 parent f2caeca commit d5ee0e5

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

cmd/gitbase/command/server.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"regexp"
1010
"runtime"
1111
"strconv"
12+
"strings"
1213
"time"
1314

1415
"github.com/src-d/gitbase"
@@ -384,26 +385,26 @@ func parseDirectory(dir directory) (directory, error) {
384385
}
385386

386387
val := v[0]
387-
switch k {
388+
switch strings.ToLower(k) {
388389
case "format":
389390
if val != "siva" && val != "git" {
390-
logrus.Errorf("invalid format in directory, it can only "+
391+
logrus.Errorf("invalid value in format, it can only "+
391392
"be siva or git %v", val)
392393
return dir, ErrInvalid
393394
}
394395
dir.Format = val
395396

396397
case "bare":
397398
if val != "true" && val != "false" {
398-
logrus.Errorf("invalid format in bare, it can only "+
399+
logrus.Errorf("invalid value in bare, it can only "+
399400
"be true or false %v", val)
400401
return dir, ErrInvalid
401402
}
402403
dir.Bare = (val == "true")
403404

404405
case "rooted":
405406
if val != "true" && val != "false" {
406-
logrus.Errorf("invalid format in rooted, it can only "+
407+
logrus.Errorf("invalid value in rooted, it can only "+
407408
"be true or false %v", val)
408409
return dir, ErrInvalid
409410
}
@@ -412,7 +413,7 @@ func parseDirectory(dir directory) (directory, error) {
412413
case "bucket":
413414
num, err := strconv.Atoi(val)
414415
if err != nil {
415-
logrus.Errorf("invalid number in bucket: %v", val)
416+
logrus.Errorf("invalid value in bucket: %v", val)
416417
return dir, ErrInvalid
417418
}
418419
dir.Bucket = num

docs/using-gitbase/getting-started.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,16 @@ If all the directories are in the same format you can set it globally with these
126126
* `--format`: it can be either `git` for filesystem repositories or `siva` for siva archives
127127
* `--bare`: specifies that git archives are bare, can only be used with `git` format
128128
* `--bucket`: sets the number of characters to use for bucketing, used with `siva` libraries
129-
* `--rooted`: enables or disables rooted reposotories management in `siva` libraries
129+
* `--non-rooted`: disables rooted repositories management in `siva` libraries
130130

131-
If you are mixing formats you can specify each directory as a `file://` url with the same global parameters. For example:
131+
If you are mixing formats you can specify each directory as a `file://` URL with these parameters:
132+
133+
* `format`: can be `git` or `siva`
134+
* `bare`: `true` or `false`
135+
* `bucket`: the characters to use for directory bucketing
136+
* `rooted`: `true` or `false`
137+
138+
For example:
132139

133140
```
134141
-d 'file:///path/to/git?format=git&bare=true' -d 'file:///path/to/sivas?format=siva&rooted=false&bucket=0'

0 commit comments

Comments
 (0)