Skip to content

CLI error on invalid parameters. #29369

@MicahZoltu

Description

@MicahZoltu

What is the problem this feature would solve?

bun install --dryrun
# oh god, no!  I wanted to do a dry run, not install everything!

bun install --frozenlockfile
# why is my build failing inside a docker container despite it working last week?!

bun install --halp
# ahhh!!! my poor SSD is being ruined, I just wanted some help

bun install --dontsave sketchy-package
# I guess I get that in production...

The above are all illustrations of bad things that can happen with a single command when a CLI doesn't hard crash when parameters fail to parse. This is very much a non-exhaustive list and meant to just be illustrative. With more thought I'm sure people can come up with all sorts of typos that will do extremely bad things.

If you pass a parameter to the CLI that it doesn't understand, it should hard fail rather than behaving like JavaScript and trying to guess what you may have actually wanted.

What is the feature you are proposing to solve the problem?

I would like the CLI to fail hard when I give it invalid parameters.

What alternatives have you considered?

Improving my memory. I have tried every trick in the book to improve my ability to memorize every possible command line option that bun provides, but to this day I still sometimes get them wrong.

Type better. I also spend 8 hours a day practicing my typing, yet I still make mistakes.

These solutions seem inferior to just having the CLI error on parse failure as they don't scale well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions