civo / cli-rubygem

Command line interface for interacting with Civo's cloud API
https://www.civo.com
MIT License
15 stars 4 forks source link

Get the ID of things with -q #30

Closed alexellis closed 5 years ago

alexellis commented 5 years ago

In docker I can do this:

# give all containers in a grid
docker ps

# give the IDs of containers on new lines, with no heading
docker ps -q

I'd like to do the same in the Civo CLI for scripting.

An example of what I'd like to do:

civo k8s ls -q | xargs civo k8s rm

I think that mirroring the CLI experience from the docker command would appeal to the cloud native persona

kaihoffman commented 5 years ago

Just the ID? So you're looking for the output to be along the lines of:

$ civo k8s ls -q
58217aad-81c9-4cb3-9675-0fd070789d9d
5d61621a-f9c1-4261-b863-2a205792b12f
$
alexellis commented 5 years ago

Yes, just like the Docker command. Try the examples above and see how they work.