puppetlabs-toy-chest / wash

Wide Area SHell: a cloud-native shell for bringing remote infrastructure to your terminal.
https://puppetlabs.github.io/wash
Apache License 2.0
180 stars 29 forks source link

Support multiple arguments for ls, meta, signal, winfo and clear + other improvements #625

Closed ekinanp closed 4 years ago

ekinanp commented 4 years ago

Resolves https://github.com/puppetlabs/wash/issues/598

ekinanp commented 4 years ago

ls' usage is meant to be as consistent as possible with the built-in ls. Here are some examples:

wash . ❯ ls docker
containers/
volumes/
wash . ❯ ls -l docker
containers/   <unknown>   list
volumes/      <unknown>   list
wash . ❯ ls docker docker/containers/wash_tutorial_redis_1/log aws foo bar
ls: bar: puppetlabs.wash/plugin-does-not-exist: Plugin bar does not exist
ls: foo: puppetlabs.wash/plugin-does-not-exist: Plugin foo does not exist
docker/containers/wash_tutorial_redis_1/log

aws:
demo_one/
demo_two/

docker:
containers/
volumes/
wash . ❯ ls -l docker docker/containers/wash_tutorial_redis_1/log aws foo bar
ls: bar: puppetlabs.wash/plugin-does-not-exist: Plugin bar does not exist
ls: foo: puppetlabs.wash/plugin-does-not-exist: Plugin foo does not exist
docker/containers/wash_tutorial_redis_1/log   <unknown>   read, stream

aws:
demo_one/                                     <unknown>   list
demo_two/                                     <unknown>   list

docker:
containers/                                   <unknown>   list
volumes/                                      <unknown>   list
ekinanp commented 4 years ago

winfo and meta output a map of <path> => <info>/<metadata> when given multiple paths. For a single path, their output remains the same as before (so <info>/<metadata>)

ekinanp commented 4 years ago

Ok, updated to clean-up ls' implementation and to parallelize data fetching in ls, winfo and meta.