Skip to content

Commit

Permalink
Support alternative './...' syntax for finder (#664)
Browse files Browse the repository at this point in the history
Support alternative './...' syntax for finder
  • Loading branch information
caglar10ur authored Feb 14, 2017
1 parent 9bda6c3 commit f3cf126
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion find/finder.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func (f *Finder) managedObjectList(ctx context.Context, path string, tl bool, in
}

if tl {
if path == "/**" {
if path == "/**" || path == "./..." {
// TODO: support switching to find mode for any path, not just relative to f.rootFolder or f.dcReference
path = "*"
} else {
Expand Down
2 changes: 1 addition & 1 deletion govc/emacs/govc.el
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ Return value is `json-read'."

(defun govc-ls-datacenter ()
"List datacenters."
(govc "ls" "-t" "Datacenter" "/**"))
(govc "ls" "-t" "Datacenter" "./..."))

(defun govc-object-prompt (prompt ls)
"PROMPT for object name via LS function. Return object without PROMPT if there is just one instance."
Expand Down
8 changes: 8 additions & 0 deletions govc/test/ls.bats
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ load test_helper
assert_success
[ ${#lines[@]} -ge $n ]

run govc ls ./...
assert_success
[ ${#lines[@]} -ge $n ]

run govc ls -t HostSystem '*'
assert_success
[ ${#lines[@]} -eq 0 ]
Expand All @@ -23,6 +27,10 @@ load test_helper
assert_success
[ ${#lines[@]} -eq 1 ]

run govc ls -t HostSystem ./...
assert_success
[ ${#lines[@]} -eq 1 ]

run govc ls host
assert_success
[ ${#lines[@]} -ge 1 ]
Expand Down

0 comments on commit f3cf126

Please sign in to comment.