From 343dc11702bf71876795b5d158cad860deca53a1 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 28 Oct 2016 21:28:18 +0200 Subject: 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. --- guix/scripts/hash.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'guix') 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) -- cgit v1.2.3