Skip to content

Commit

Permalink
Merge branch 'release/0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoconti83 committed Dec 7, 2015
2 parents adf329e + 1be9a5d commit f4f5f3b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 21 deletions.
4 changes: 2 additions & 2 deletions Examples/echo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ import Targone
var parser = ArgumentParser(summary: "Echoes some text on stdin")

// Method 1: add and retrieve final value by argument
let repetitionsArg = OptionalArgument<Int>("num", shortLabel: "n", defaultValue: 1)
let repetitionsArg = OptionalArgument<Int>("num", shortLabel: "n", defaultValue: 1, help: "how many times to print the text")
parser.addArgument(repetitionsArg)
let textArg = PositionalArgument<String>("text")
parser.addArgument(textArg)

// Method 2: add and retrieve final value by label
parser.addArgument(FlagArgument("quotes"))
parser.addArgument(FlagArgument("quotes", help: "enclode text within quotes"))

// Parse
let args = parser.parse()
Expand Down
20 changes: 1 addition & 19 deletions Tests/ArgumentParserTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,24 +57,6 @@ class ArgumentParserTests: XCTestCase {
return ""
}
}

func compareStringsAndFail(s1: String?, _ s2: String) {
let dump = { (s: String) in
return "➡️\(s)⬅️ size: \(s.characters.count)"
}
if s1 != s2 {
if let s1 = s1 {
print("EXPECTED")
print(dump(s2))
print("FOUND")
print(dump(s1))
}
else {
print("String is nil")
}
}
XCTAssertEqual(s1, s2)
}
}

// MARK: - Description
Expand Down Expand Up @@ -204,7 +186,7 @@ extension ArgumentParserTests {
positionalArguments.forEach { sut.addArgument($0) }

// then
compareStringsAndFail(sut.description, expected)
XCTAssertEqual(sut.description, expected)
}
}

Expand Down

0 comments on commit f4f5f3b

Please sign in to comment.