aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-02-22 07:27:03 +0000
committerGitHub <noreply@github.com>2021-02-22 15:27:03 +0800
commit960668ccdb8a3498ee61387648c457f242cfe29c (patch)
tree0f8c5113b625037911e6e16a0764c9f3debf9c2c /bin
parent55b59407e44bcccf0068d6ae2dc3f446d60809b4 (diff)
downloadtracifyjs-960668ccdb8a3498ee61387648c457f242cfe29c.tar.gz
tracifyjs-960668ccdb8a3498ee61387648c457f242cfe29c.zip
improve CLI usability (#4670)
closes #3308
Diffstat (limited to 'bin')
-rwxr-xr-xbin/uglifyjs7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/uglifyjs b/bin/uglifyjs
index 60335426..35f06412 100755
--- a/bin/uglifyjs
+++ b/bin/uglifyjs
@@ -260,9 +260,14 @@ if (paths.length) {
});
run();
} else {
+ var timerId = process.stdin.isTTY && process.argv.length < 3 && setTimeout(function() {
+ print_error("Waiting for input... (use `--help` to print usage information)");
+ }, 1500);
var chunks = [];
process.stdin.setEncoding("utf8");
- process.stdin.on("data", function(chunk) {
+ process.stdin.once("data", function() {
+ clearTimeout(timerId);
+ }).on("data", function(chunk) {
chunks.push(chunk);
}).on("end", function() {
files = { STDIN: chunks.join("") };