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

Commands like "droplets" need formatting switches #206

Closed
adamierymenko opened this issue Nov 4, 2015 · 6 comments
Closed

Commands like "droplets" need formatting switches #206

adamierymenko opened this issue Nov 4, 2015 · 6 comments

Comments

@adamierymenko
Copy link

Commands like "droplets" need formatting switches to do things like only list IPs to avoid stuff like:

tugboat droplets | grep -F TEST | cut -d : -f 2 | cut -d ' ' -f 2 | cut -d , -f 1 >>big-test-hosts
@petems
Copy link
Owner

petems commented Nov 10, 2015

Makes sense.

Hmm, this would probably be easiest by extending the porcelain mode from the info method into the droplets method.

$ tugboat info -n foo-node --porcelain --attribute=ip4
10.0.1.1

How would you like it to look when it outputs, something like this:

$ tugboat droplets --porcelain --attribute=ip4
foo-node, 10.0.1.1

@petems
Copy link
Owner

petems commented Dec 1, 2015

@adamierymenko Can you give an example of how you want it to look?

Do you want a CSV style output like we do for info and --porcelain mode:

$ tugboat droplets --porcelain --attribute=ip4
foo-node, 10.0.1.1
foo-node2, 10.0.1.2

@adamierymenko
Copy link
Author

CSV would be fine, and ditch the extra spaces since it requires an extra 'cut' or 'sed' etc. from the command line. Goal is to make it easy to script stuff.

@petems
Copy link
Owner

petems commented Dec 3, 2015

Could also do an output format flag: csv, yaml or JSON 👍

@petems
Copy link
Owner

petems commented Dec 3, 2017

@adamierymenko Are you still using tugboat? Bit late now (2 years!) but I finally got this working now:

$ tugboat droplets --attribute=ip4
test-blog-1,41.101.11.22
test-blog-2,138.68.11.22

Got it up as a PR here: #294

@petems
Copy link
Owner

petems commented Dec 3, 2017

@psobot Also liked this issue, are you interested in trying this?

I've just merged this into master, any problems feel free to open a new issue or PR 👍

@petems petems closed this as completed Dec 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants