Skip to content

Commit

Permalink
Updated usage examples
Browse files Browse the repository at this point in the history
  • Loading branch information
shyiko committed Jul 27, 2016
1 parent 478e7a4 commit 585e40f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ $ ktlint
# check only certain locations (prepend ! to negate the pattern)
$ ktlint "src/**/*.kt" "!src/**/*Test.kt"

# correct style violations in place
# auto-correct style violations
$ ktlint -F "src/**/*.kt"
```

Expand Down
13 changes: 8 additions & 5 deletions src/main/kotlin/com/github/shyiko/ktlint/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ object Main {

private fun CmdLineParser.usage(): String =
"""
Kotlin Standard Style (https://github.com/shyiko/ktlint).
Kotlin linter (https://github.com/shyiko/ktlint).
Usage:
ktlint <flags> [patterns]
Expand All @@ -55,12 +55,15 @@ ${ByteArrayOutputStream().let { this.printUsage(it); it }.toString().trimEnd().s
.joinToString("\n")}
Examples:
# lint all **/*.kt and **/*.kts files starting from the current working directory.
# NOTE: hidden directories (beginning with .) and files present in .gitignore will not be checked.
# check the style of all Kotlin files inside the current dir (recursively)
# (hidden folders will be skipped)
ktlint
# lint kotlin files under src/main/kotlin
ktlint "src/main/kotlin/**/.kt{,s}"
# check only certain locations (prepend ! to negate the pattern)
ktlint "src/**/*.kt" "!src/**/*Test.kt"
# auto-correct style violations
ktlint -F "src/**/*.kt"
""".trimIndent()

@JvmStatic
Expand Down

0 comments on commit 585e40f

Please sign in to comment.