ginkgo-project / ssget

Command line tool for working with matrices from the SuiteSparse Matrix Collection (sparse.tamu.edu)
Other
8 stars 4 forks source link

Slient mode when downloading a matrix #3

Closed TheSlimvReal closed 5 years ago

TheSlimvReal commented 5 years ago

I added the "-o" flag to the available options. When setting this flag, ssget won't produce any console logs. This alows users to use ssget in their programs withouth having their console full of logs produced by the downloading of the matrices. Using ssget (...) &>/dev/null only turns off the echos by ssget itself but will remain printing the download process.

gflegar commented 5 years ago

Just redirecting the standard error to /dev/null should do the trick without the need for this PR:

[gflegar@omen ~]$ ssget -ri2310 2>/dev/null # make sure the matrix files are deleted
104922
[gflegar@omen ~]$ ssget -fi2310 2>/dev/null # download the matrix archive
/home/gflegar/.config/ssget/MM/SNAP/p2p-Gnutella06.tar.gz

I'm also not getting any output when using the &> redirection:

[gflegar@omen ~]$ ssget -ri2310 &>/dev/null
[gflegar@omen ~]$ ssget -fi2310 &>/dev/null

Maybe you're using an older, buggy version of bash?

[gflegar@omen ~]$ bash --version
GNU bash, version 5.0.0(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

You can also try this as a workaround:

[gflegar@omen ~]$ ssget -ri2310 >/dev/null 2>&1
[gflegar@omen ~]$ ssget -fi2310 >/dev/null 2>&1
TheSlimvReal commented 5 years ago

Thanks, you are right, I propably used a command that was not supported in my bash.