Skip to content

Misspelled flags in CLI can cause user data loss #465

@grodin

Description

@grodin

As part of working on #391, I realised that typo'd flags in the CLI don't stop processing. Since ktfmt overwrites files by default, that's pretty dangerous!

E.g.

$ ktfmt --dry-runn SomeFile.kt

will report the unexpected option --dry-runn but will format and overwrite SomeFile.kt anyway!

I thought this was enough of a showstopper to report it separately.

IMO, all unknown flags should be errors, and no processing should take place when they're encountered.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions