mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
30 lines
1.1 KiB
Swift
30 lines
1.1 KiB
Swift
import Commandant
|
|
import SwiftLintFramework
|
|
|
|
func pathOption(action: String) -> Option<String> {
|
|
return Option(key: "path",
|
|
defaultValue: "",
|
|
usage: "the path to the file or directory to \(action)")
|
|
}
|
|
|
|
func pathsArgument(action: String) -> Argument<[String]> {
|
|
return Argument(defaultValue: [""],
|
|
usage: "list of paths to the files or directories to \(action)")
|
|
}
|
|
|
|
let configOption = Option(key: "config",
|
|
defaultValue: Configuration.fileName,
|
|
usage: "the path to SwiftLint's configuration file")
|
|
|
|
let useScriptInputFilesOption = Option(key: "use-script-input-files",
|
|
defaultValue: false,
|
|
usage: "read SCRIPT_INPUT_FILE* environment variables " +
|
|
"as files")
|
|
|
|
func quietOption(action: String) -> Option<Bool> {
|
|
return Option(key: "quiet",
|
|
defaultValue: false,
|
|
usage: "don't print status logs like '\(action.capitalized) <file>' & " +
|
|
"'Done \(action)'")
|
|
}
|