Skip to content

Commit 4111cc9

Browse files
committed
[plutil][gardening] Remove unnecessary breaks
1 parent 146ec3b commit 4111cc9

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

Tools/plutil/main.swift

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -74,37 +74,30 @@ func parseArguments(_ args: [String]) throws -> Options {
7474
while let path = iterator.next() {
7575
opts.inputs.append(path)
7676
}
77-
break
7877
case "-s":
7978
opts.silent = true
80-
break
8179
case "-o":
8280
if let path = iterator.next() {
8381
opts.output = path
8482
} else {
8583
throw OptionParseError.missingArgument("-o requires a path argument")
8684
}
87-
break
8885
case "-convert":
8986
opts.mode = .convert
9087
if let format = iterator.next() {
9188
switch format {
9289
case "xml1":
9390
opts.conversionFormat = .xml1
94-
break
9591
case "binary1":
9692
opts.conversionFormat = .binary1
97-
break
9893
case "json":
9994
opts.conversionFormat = .json
100-
break
10195
default:
10296
throw OptionParseError.invalidFormat(format)
10397
}
10498
} else {
10599
throw OptionParseError.missingArgument("-convert requires a format argument of xml1 binary1 json")
106100
}
107-
break
108101
case "-e":
109102
if let ext = iterator.next() {
110103
opts.fileExtension = ext
@@ -113,18 +106,14 @@ func parseArguments(_ args: [String]) throws -> Options {
113106
}
114107
case "-help":
115108
opts.mode = .help
116-
break
117109
case "-lint":
118110
opts.mode = .lint
119-
break
120111
case "-p":
121112
opts.mode = .print
122-
break
123113
default:
124114
if arg.hasPrefix("-") && arg.utf8.count > 1 {
125115
throw OptionParseError.unrecognizedArgument(arg)
126116
}
127-
break
128117
}
129118
}
130119

@@ -380,13 +369,10 @@ func main() -> Int32 {
380369
case .unrecognizedArgument(let arg):
381370
print("unrecognized option: \(arg)")
382371
let _ = help()
383-
break
384372
case .invalidFormat(let format):
385373
print("unrecognized format \(format)\nformat should be one of: xml1 binary1 json")
386-
break
387374
case .missingArgument(let errorStr):
388375
print(errorStr)
389-
break
390376
}
391377
return EXIT_FAILURE
392378
}

0 commit comments

Comments
 (0)