Skip to content

Commit

Permalink
fix(get): Datasets whose name contains a field should work with get
Browse files Browse the repository at this point in the history
  • Loading branch information
dustmop committed Jan 25, 2019
1 parent 55f9db8 commit 97410fb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ type GetOptions struct {
}

// isDatasetField checks if a string is a dataset field or not
var isDatasetField = regexp.MustCompile("(?i)commit|structure|body|meta|viz|transform")
var isDatasetField = regexp.MustCompile("(?i)^(commit|structure|body|meta|viz|transform)$")

// Complete adds any missing configuration that can only be added just before calling Run
func (o *GetOptions) Complete(f Factory, args []string) (err error) {
Expand Down
1 change: 1 addition & 0 deletions cmd/get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func TestGetComplete(t *testing.T) {
{[]string{"peer/ds_two", "peer/ds"}, "", []string{"peer/ds_two", "peer/ds"}, ""},
{[]string{"foo", "peer/ds"}, "", []string{"foo", "peer/ds"}, ""},
{[]string{"structure"}, "structure", []string{}, ""},
{[]string{"peer/human_body_facts"}, "", []string{"peer/human_body_facts"}, ""},
}

for i, c := range cases {
Expand Down

0 comments on commit 97410fb

Please sign in to comment.