diff --git a/src/tools/ceph_objectstore_tool.cc b/src/tools/ceph_objectstore_tool.cc index 2d433916e89..b3c854b8013 100644 --- a/src/tools/ceph_objectstore_tool.cc +++ b/src/tools/ceph_objectstore_tool.cc @@ -1939,9 +1939,9 @@ int main(int argc, char **argv) file_fd = fd_none; if (op == "export") { - if (!vm.count("file")) { + if (!vm.count("file") || file == "-") { if (outistty) { - cerr << "stdout is a tty and no --file option specified" << std::endl; + cerr << "stdout is a tty and no --file filename specified" << std::endl; exit(1); } file_fd = STDOUT_FILENO; @@ -1949,9 +1949,9 @@ int main(int argc, char **argv) file_fd = open(file.c_str(), O_WRONLY|O_CREAT|O_TRUNC, 0666); } } else if (op == "import") { - if (!vm.count("file")) { + if (!vm.count("file") || file == "-") { if (isatty(STDIN_FILENO)) { - cerr << "stdin is a tty and no --file option specified" << std::endl; + cerr << "stdin is a tty and no --file filename specified" << std::endl; exit(1); } file_fd = STDIN_FILENO;