Deno: Feature Request: quiet or silent flag

Created on 20 Oct 2019  Â·  5Comments  Â·  Source: denoland/deno

Sometimes (a lot of the time) running the same program twice and getting different outputs is highly undesirable. But this happens regularly with Deno programs due to the

Compiling file:///path/to/file.ts

info message which gets outputted to stderr when a file is compiled when running a program.

A way to silence these messages would be very useful.
So the idea is to implement a quiet (-q, --quiet) or silent (-s, --silent) command line flag, (personally I like the quiet naming better) which would prevent these info messages from being outputted. Additionally I think it would be reasonable for this flag to imply the behavior of --no-prompt, though I'm unsure about what's happening with that flag (See #2767), but automatically denying permissions queries is very useful in the same vein as silencing the compiling info message, so merging the functionality in to a single flag seems reasonable.

(This flag wouldn't generally be used directly on the command line, but instead in placed where deno programs are called by another program)

Most helpful comment

-q/--quiet flag was added in 62f4a2a788a46af88e47472738d1a98fa247b9b0

All 5 comments

One use case where I imagine this being useful would be in a docker deployment.

  • I'd want my script to only output its own output (without compile messages).
  • I wouldn't want it to prompt for permissions. (I'd want it to fail fast.)
  • I'd want to disable pulling any scripts (and only use local or even cached scripts) with the --no-fetch. (This would be a useful tool for ensuring a deterministic build. Bundling may also help address this use case.)

I'd basically imagine running with:

deno --quiet --no-prompt --no-fetch

Sure, sounds like a reasonable feature.

Tangental: @andyfleming - I want to remove --no-prompt - scripts are going to just die if they don't have the correct permissions rather than giving a prompt.

@ry — That sounds like a better default.

(additional thoughts migrated to #2767)

IMO, this makes most sense as a global flag, i.e. not scoped to the run command. deno test already has an (unused) -q/--quiet flag that can be repurposed for this. The PR I added shows this approach.

-q/--quiet flag was added in 62f4a2a788a46af88e47472738d1a98fa247b9b0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ry picture ry  Â·  3Comments

kitsonk picture kitsonk  Â·  3Comments

davidbarratt picture davidbarratt  Â·  3Comments

zugende picture zugende  Â·  3Comments

JosephAkayesi picture JosephAkayesi  Â·  3Comments