diff options
Diffstat (limited to 'src/cli/utils.cpp')
-rw-r--r-- | src/cli/utils.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cli/utils.cpp b/src/cli/utils.cpp index f3ce5f0f9..9302ec5d0 100644 --- a/src/cli/utils.cpp +++ b/src/cli/utils.cpp @@ -124,7 +124,11 @@ class Hash : public Command const size_t buf_size = get_arg_sz("buf-size"); - for(auto fsname : get_arg_list("files")) + auto files = get_arg_list("files"); + if(files.empty()) + files.push_back("-"); // read stdin if no arguments on command line + + for(auto fsname : files) { auto update_hash = [&](const uint8_t b[], size_t l) { hash_fn->update(b, l); }; read_file(fsname, update_hash, buf_size); |