diff options
author | Ludovic Courtès <ludo@gnu.org> | 2016-10-28 21:28:18 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2016-10-28 22:30:17 +0200 |
commit | 343dc11702bf71876795b5d158cad860deca53a1 (patch) | |
tree | f76669e9a32c799380fb7246adddd3521f55a733 /guix | |
parent | 12b6c951cf5ca6055a22a2eec85665353f5510e5 (diff) | |
download | gnu-guix-343dc11702bf71876795b5d158cad860deca53a1.tar gnu-guix-343dc11702bf71876795b5d158cad860deca53a1.tar.gz |
guix hash: Interpret '-' as standard input.
* guix/scripts/hash.scm (guix-hash)[file-hash]: Special-case "-".
* tests/guix-hash.sh: Add test.
* doc/guix.texi (Invoking guix hash): Document it.
Diffstat (limited to 'guix')
-rw-r--r-- | guix/scripts/hash.scm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/guix/scripts/hash.scm b/guix/scripts/hash.scm index b269ead50f..a339a8556b 100644 --- a/guix/scripts/hash.scm +++ b/guix/scripts/hash.scm @@ -139,7 +139,9 @@ and 'hexadecimal' can be used as well).\n")) (write-file file port #:select? select?) (force-output port) (get-hash)) - (call-with-input-file file port-sha256)))) + (match file + ("-" (port-sha256 (current-input-port))) + (_ (call-with-input-file file port-sha256)))))) (match args ((file) |