File tree Expand file tree Collapse file tree 4 files changed +27
-0
lines changed
Expand file tree Collapse file tree 4 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ import Commander
2+
3+ let group = Group {
4+ $0. command ( " login " ) { ( username: String ) in
5+ print ( " You are now logged in \( username) . " )
6+ }
7+
8+ $0. command ( " logout " ) {
9+ print ( " You are not logged out. " )
10+ }
11+ }
12+
13+ group. run ( [ ] )
14+ group. run ( [ " login " , " kyle " ] )
15+ group. run ( [ " logout " ] )
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" standalone =" yes" ?>
2+ <playground version =' 5.0' target-platform =' osx' requires-full-environment =' true' display-mode =' raw' >
3+ <timeline fileName =' timeline.xctimeline' />
4+ </playground >
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <Timeline
3+ version = " 3.0" >
4+ <TimelineItems >
5+ </TimelineItems >
6+ </Timeline >
Original file line number Diff line number Diff line change 4646 279256B31BB3260D00E66B9E /* Group.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Group.swift; sourceTree = "<group>"; };
4747 279256B51BB32A8E00E66B9E /* ArgumentConvertible.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ArgumentConvertible.swift; sourceTree = "<group>"; };
4848 279256B71BB32B3F00E66B9E /* ArgumentConvertibleTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ArgumentConvertibleTests.swift; sourceTree = "<group>"; };
49+ 279256B91BB32E4200E66B9E /* Commander.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = Commander.playground; sourceTree = "<group>"; };
4950 27B1A0FE1BACD69500B1260F /* ArgumentParserTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ArgumentParserTests.swift; sourceTree = "<group>"; };
5051/* End PBXFileReference section */
5152
7172 2768A2161BACC38C00F994EE = {
7273 isa = PBXGroup;
7374 children = (
75+ 279256B91BB32E4200E66B9E /* Commander.playground */,
7476 2768A2221BACC38C00F994EE /* Commander */,
7577 2768A22E1BACC38C00F994EE /* CommanderTests */,
7678 2768A2211BACC38C00F994EE /* Products */,
You can’t perform that action at this time.
0 commit comments