minos-org/minos-static

feature request: output tar to stdout

Closed this issue · 5 comments

Would it be much effort to implement a command to output the downloaded tar to stdout?

Of course I can always wrap static-get into an own script, but it would be much more comfortable to have this feature already in the original ...

Hi @TomNussbaumer,

That's a good idea, and shouldn't take a lot of effort, I'll work on it as soon as I get some spare time, shouldn't be more than a couple of days..

Feel free to keep opening bug reports

Hi @TomNussbaumer ,

I've added an -o/--output option in commit 08fb0bd which accepts regular files and '-' to redirecting to stdout.

It can be used like this:

static-get -f xz -o- allcaps-1-1 > file.tar.xz
static-get -f xz --output - allcaps-1-1 |  tar Jxf -

If you have further ideas to improve the mechanism, let me know.

Wow, that was fast.

That's especially useful when embedding static-get in a Docker container. This way you don't need to bind-mount any host directory, but just pipe the output of the container run wherever you want.

Thanx alot!

After some testing:

-o- .... works great
--output - ...doesn't work (nor does --output=-)

Thanks for the catch,

As you said, --output wasn't working, hopefully it will be fixed in the latest commit eedf83d

The syntax can be either --output -, --output-, -o - or -o- but not --output=-, sh option parsing isn't really flexible