Skip to content

Commit c35f454

Browse files
committed
kebab-case options
1 parent 676d64b commit c35f454

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,17 +95,18 @@ Options:
9595
--precision maximum number of decimal places
9696
--output optional path of output file
9797
98-
--hideUnsupportedFilters hide elements with unsupported filters.
98+
--hide-unsupported-filters hide elements with unsupported filters.
9999
100100
Available keys for --format swift:
101101
--api api of generated code: appkit | uikit
102102
103103
Available keys for --format sfsymbol:
104104
--insets alignment of regular variant: top,left,bottom,right | auto
105105
--ultralight svg file of ultralight variant
106-
--ultralightInsets alignment of ultralight variant: top,left,bottom,right | auto
106+
--ultralight-insets alignment of ultralight variant: top,left,bottom,right | auto
107107
--black svg file of black variant
108-
--blackInsets alignment of black variant: top,left,bottom,right | auto
108+
--black-insets alignment of black variant: top,left,bottom,right | auto
109+
--legacy use the original, less precise alignment logic from earlier swiftdraw versions.
109110
```
110111

111112
```bash

SwiftDraw/Sources/CommandLine/CommandLine.Configuration.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,14 @@ extension CommandLine {
210210

211211
static func parseInsets(from value: String??) throws -> Insets? {
212212
guard let value = value,
213-
let value = value,
214-
value != "auto" else {
213+
let value = value else {
215214
return nil
216215
}
217216

217+
guard value != "auto" else {
218+
return Insets()
219+
}
220+
218221
var scanner = XMLParser.Scanner(text: value)
219222
let top = try scanner.scanInset()
220223
_ = try scanner.scanString(",")

SwiftDraw/Tests/CommandLine/CommandLine.ArgumentsTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ final class CommandLineArgumentsTests: XCTestCase {
4242
XCTAssertEqual(modifiers, [.ultralightInsets: "a", .blackInsets: "b", .hideUnsupportedFilters: nil, .legacy: nil])
4343

4444
modifiers = try CommandLine.parseModifiers(from: ["--ultralight-insets", "a", "--black-insets", "b", "--hide-unsupported-filters", "--legacy"])
45-
XCTAssertEqual(modifiers, [.ultralightInsets: "a", .blackInsets: "b", .hideUnsupportedFilters: nil, .legacy: nil])"
45+
XCTAssertEqual(modifiers, [.ultralightInsets: "a", .blackInsets: "b", .hideUnsupportedFilters: nil, .legacy: nil])
4646

4747
}
4848

SwiftDraw/Tests/CommandLine/CommandLine.ConfigurationTests.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,8 @@ final class CommandLineConfigurationTests: XCTestCase {
9090
}
9191

9292
func testParseInsets() throws {
93-
XCTAssertEqual(
94-
try CommandLine.parseInsets(from: nil),
95-
.init()
93+
XCTAssertNil(
94+
try CommandLine.parseInsets(from: nil)
9695
)
9796
XCTAssertEqual(
9897
try CommandLine.parseInsets(from: "auto"),

0 commit comments

Comments
 (0)