uskudnik / amazon-glacier-cmd-interface

Command line interface for Amazon Glacier
MIT License
375 stars 103 forks source link

Shell-script friendly ouput mode and return codes #132

Open ikatson opened 11 years ago

ikatson commented 11 years ago

Hi,

I assume that many usecases of glacier-cmd are integrating it into various backup scripts. No of the current output modes are shell-script friendly. For example, to get a list of vaults, which can be iterated in the shell, I do

glacier-cmd --output csv lsvault | cut -d , -f 4 | tr -d '"' | tail -n +2

while something like

glacier-cmd [--output=shell] lsvault

would be a lot more shell-friendly.

And the program always returns 0, while returning 1 sometimes would benefit. Consider the search command, which could use grep-style return codes, i.e. 0 if something was found and 1 if not.

Cheers, Igor Katson.

P.S. Thanks for a very cool and useful tool, I like it better than "glacier.py" which has more stars on github, at least cause your one uses Amazon for persistent storage, which allows backing up from different machines.