Skip to content

Feature Request: quiet or silent flag #3162

@qwerasd205

Description

@qwerasd205
Contributor

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)

Activity

andyfleming

andyfleming commented on Oct 20, 2019

@andyfleming
Contributor

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
ry

ry commented on Oct 21, 2019

@ry
Member

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.

andyfleming

andyfleming commented on Oct 21, 2019

@andyfleming
Contributor

@ry — That sounds like a better default.

(additional thoughts migrated to #2767)

codeflo

codeflo commented on Feb 25, 2020

@codeflo
Contributor

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.

bartlomieju

bartlomieju commented on Mar 10, 2020

@bartlomieju
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ry@codeflo@andyfleming@qwerasd205@bartlomieju

        Issue actions

          Feature Request: quiet or silent flag · Issue #3162 · denoland/deno