@@ -42,13 +42,6 @@ extension AbsolutePath: ExpressibleByArgument {
42
42
}
43
43
}
44
44
45
- struct CommandLineOptions {
46
- /// Options for the server.
47
- var serverOptions : SourceKitServer . Options = SourceKitServer . Options ( )
48
-
49
- var syncRequests : Bool = false
50
- }
51
-
52
45
extension LogLevel : ExpressibleByArgument { }
53
46
extension BuildConfiguration : ExpressibleByArgument { }
54
47
@@ -62,12 +55,12 @@ struct Main: ParsableCommand {
62
55
@Flag ( name: . customLong( " sync " ) )
63
56
var syncRequests = false
64
57
65
- @Option ( help: " Set the logging level ( debug|info|warning|error) " )
66
- var logLevel : LogLevel = LogLevel . default
58
+ @Option ( help: " Set the logging level [ debug|info|warning|error] (default: \( LogLevel . default ) ) " )
59
+ var logLevel : LogLevel ?
67
60
68
61
@Option (
69
62
name: [ . customLong( " configuration " ) , . customShort( " c " ) ] ,
70
- help: " Build with configuration ( debug|release) "
63
+ help: " Build with configuration [ debug|release] "
71
64
)
72
65
var buildConfiguration = BuildConfiguration . debug
73
66
@@ -122,13 +115,11 @@ struct Main: ParsableCommand {
122
115
var indexDatabasePath : AbsolutePath ?
123
116
124
117
@Option (
125
- name: . customLong( " completion-server-side-filtering " , withSingleDash: true ) ,
126
118
help: " Whether to enable server-side filtering in code-completion "
127
119
)
128
120
var completionServerSideFiltering = true
129
121
130
122
@Option (
131
- name: . customLong( " completion-max-results " , withSingleDash: true ) ,
132
123
help: " When server-side filtering is enabled, the maximum number of results to return "
133
124
)
134
125
var completionMaxResults = 200
@@ -152,8 +143,10 @@ struct Main: ParsableCommand {
152
143
}
153
144
154
145
func run( ) throws {
155
- if !Logger . shared . setLogLevel ( environmentVariable : " SOURCEKIT_LOGGING " ) {
146
+ if let logLevel = logLevel {
156
147
Logger . shared. currentLevel = logLevel
148
+ } else {
149
+ Logger . shared. setLogLevel ( environmentVariable: " SOURCEKIT_LOGGING " )
157
150
}
158
151
159
152
// Dup stdout and redirect the fd to stderr so that a careless print()
0 commit comments