Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "printAST" sub command. #500

Merged
merged 1 commit into from
Jul 3, 2019

Conversation

Tapchicoma
Copy link
Collaborator

Move old one (--print-ast) option to be a ktlint sub command - new syntax:
ktlint printAST. Old one --print-ast is still working, but
deprecated.

Move old one (--print-ast) option to be a ktlint sub command - new syntax:
`ktlint printAST`. Old one `--print-ast` is still working, but
deprecated.

Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
}

companion object {
internal const val COMMAND_NAME = "printAST"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I ask what's the reasoning behind using a camel-cased command name instead of good old '--do-something' pattern for CLI tools? The old way just looks more natural imo.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main reason to move into subcommands direction - reduce user confusion and make command line usage more clear.

For example, now with only options, it is not clear if using --print-ast option will also do linting.

Though I am open to subcommand name changes as I don't have strong opinion here.

@shashachu shashachu merged commit 0fef759 into pinterest:master Jul 3, 2019
sowmyav24 pushed a commit to sowmyav24/ktlint that referenced this pull request Jul 18, 2019
Move old one (--print-ast) option to be a ktlint sub command - new syntax:
`ktlint printAST`. Old one `--print-ast` is still working, but
deprecated.

Signed-off-by: Yahor Berdnikau <egorr.berd@gmail.com>
@Tapchicoma Tapchicoma deleted the print-ast-subcommand branch March 8, 2020 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants