Skip to content

Commit

Permalink
Handle depth better
Browse files Browse the repository at this point in the history
  • Loading branch information
calmh authored and albalogic committed Feb 20, 2016
1 parent 6e99fc7 commit d8ca902
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,12 @@ func parseInodeChanges(lines [][]string) ([]*InodeChange, error) {
}

func listByType(t, filter string, depth int) ([]*Dataset, error) {
args := []string{"get", fmt.Sprintf("-d%d", depth), "-rHp", "-t", t, "all"}
var args []string
if depth > 0 {
args = []string{"get", fmt.Sprintf("-d%d", depth), "-rHp", "-t", t, "all"}
} else {
args = []string{"get", "-rHp", "-t", t, "all"}
}
if filter != "" {
args = append(args, filter)
}
Expand Down

0 comments on commit d8ca902

Please sign in to comment.