Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support alternative './...' syntax for finder #664

Merged
merged 2 commits into from
Feb 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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