├── .xctool-args ├── .gitignore ├── .gitmodules ├── .travis.yml ├── whereami ├── WAIVersionCommand.swift ├── main.swift ├── Info.plist └── WhereAmICommand.swift ├── CONTRIBUTING.md ├── LICENSE ├── README.md └── whereami.xcodeproj ├── xcshareddata └── xcschemes │ └── whereami.xcscheme └── project.pbxproj /.xctool-args: -------------------------------------------------------------------------------- 1 | ["-scheme", "whereami", 2 | "-configuration", "Release"] -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | whereami.xcodeproj/xcuserdata 2 | *.xcworkspacedata 3 | whereami.xcodeproj/project.xcworkspace/xcuserdata 4 | build 5 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "whereami/SwiftCLI"] 2 | path = whereami/SwiftCLI 3 | url = https://github.com/jakeheis/SwiftCLI.git 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | xcode_project: whereami.xcodeproj 3 | xcode_scheme: whereami 4 | xcode_sdk: macosx10.10 5 | before_install: 6 | - git submodule update --init --recursive -------------------------------------------------------------------------------- /whereami/WAIVersionCommand.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WAIVersionCommand.swift 3 | // whereami 4 | // 5 | // Created by Victor Jalencas on 14/12/14. 6 | // Copyright (c) 2014 Hand Forged. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class WAIVersionCommand : VersionCommand { 12 | 13 | override func commandName() -> String { 14 | return "version" 15 | } 16 | 17 | override func commandShortcut() -> String? { 18 | return "--version" 19 | } 20 | 21 | override func execute() -> ExecutionResult { 22 | println("whereami version \(self.version)") 23 | return success() 24 | } 25 | } -------------------------------------------------------------------------------- /whereami/main.swift: -------------------------------------------------------------------------------- 1 | // 2 | // main.swift 3 | // whereami 4 | // 5 | // Created by Victor Jalencas on 02/09/14. 6 | // Copyright © 2014 Hand Forged. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | 12 | // main code 13 | 14 | CLI.setup(name:"whereami", version:"1.0", description:"Get your location from the command line") 15 | let whereamiCommand = WhereAmICommand() 16 | let versionCommand = WAIVersionCommand() 17 | CLI.registerCustomVersionCommand(versionCommand) 18 | CLI.registerDefaultCommand(whereamiCommand) 19 | let result = CLI.go() 20 | 21 | func cliExit(result: CLIResult) { 22 | exit(result) 23 | } 24 | 25 | cliExit(result) -------------------------------------------------------------------------------- /whereami/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | LSApplicationCategoryType 6 | public.app-category.utilities 7 | NSHumanReadableCopyright 8 | © Victor Jalencas 2014 9 | CFBundleShortVersionString 10 | 1.0.0 11 | CFBundleVersion 12 | 1 13 | CFBundleName 14 | whereami 15 | CFBundleIdentifier 16 | pro.handforged.whereami 17 | 18 | 19 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | How to contribute 2 | ================= 3 | 4 | If you feel like contributing to whereas, here’s how. 5 | 6 | First of all, fork this repo and clone the fork to your local machine: 7 | 8 | ```console 9 | $ git clone git@github.com:your-username/whereami.git 10 | ``` 11 | 12 | Make sure you can build the project. There’s no tests (yet). Either build from the command line or from Xcode 13 | 14 | ```console 15 | $ xctool build 16 | ``` 17 | 18 | Make your changes, and commit them. Push to your fork, and from there submit a pull request. 19 | 20 | TODO 21 | ==== 22 | 23 | * Set a timeout for CoreLocation to fail. Sometimes it gets stuck for lack of permission (without requesting it) and then it never returns. 24 | * Write a proper man page. 25 | * Add more options for output of additional data, like altitude, precision or course, and also for input of minimum precision 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010-2014 Victor Jalencas 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/victor/whereami.svg?branch=swift)](https://travis-ci.org/victor/whereami) 2 | 3 | So what is it? 4 | ============== 5 | 6 | `whereami` is a simple command-line utility that outputs your geographical coordinates, as determined by Core Location, which uses nearby WiFi networks with known positions to pinpoint your location. It prints them to the standard output in an easy to parse format, in good UNIX fashion. 7 | 8 | 9 | Requirements 10 | ============ 11 | 12 | This version of `whereami` only works in versions of Mac OS X 10.9 (Mavericks) or greater; as it is implemented in Swift. Why in Swift? Well, mostly because the command-line parsing libraries I could find in Objective-C where either a nuisance to install (because of lack of CocoaPods support) or required a lot of code to configure the options I need. On the other hand, [SwiftCLI](https://github.com/jakeheis/SwiftCLI/blob/master/LICENSE) makes it really easy. 13 | 14 | To build it, you will require Xcode 6.1 and optionally `xctool`. You can build it from the command line using either `xcodebuild` or `xctool`, whichever you like best. Both should work equally well, but `xctool`’s output is fancier. You can install `xctool` using [homebrew](http://brew.sh). 15 | 16 | INSTALLATION 17 | ============ 18 | 19 | `whereami` comes with batteries included. You just need to clone the project to your local machine, switch to the **swift** branch, init the submodules, and install it using `xcodebuild`/`xctool`. In the near future, I will make that branch the main one, but not just yet. 20 | 21 | ```console 22 | $ git clone https://github.com/victor/whereami.git whereami 23 | $ cd whereami 24 | $ git checkout swift 25 | $ git submodule update --init --recursive 26 | $ xctool install 27 | ``` 28 | 29 | USAGE 30 | ===== 31 | 32 | Once `whereami` is installed, you can just invoke it to output your location: 33 | 34 | ```console 35 | $ whereami 36 | 41.386905825791,2.14425782089087 37 | ``` 38 | 39 | This is the default format, the tersest. You can also make it output JSON: 40 | 41 | ```console 42 | $ whereami --format json 43 | {"latitude":41.386905825791, "longitude": 2.14425782089087} 44 | ``` 45 | 46 | Or even output in sexagesimal form: 47 | 48 | ```console 49 | $ whereami --format sexagesimal 50 | 41° 23′ 12.8609728477426″, 2° 8′ 39.3281552071449″ 51 | ``` 52 | 53 | Apart from these options, the standard `--version` and `--help` options are recognized. 54 | 55 | 56 | CONTRIBUTING 57 | ============ 58 | 59 | Please see CONTRIBUTING.md for details. 60 | 61 | LICENSE 62 | ======= 63 | 64 | This code is released under the MIT license. Check the file [LICENSE](LICENSE) for details. 65 | -------------------------------------------------------------------------------- /whereami.xcodeproj/xcshareddata/xcschemes/whereami.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 51 | 52 | 58 | 59 | 60 | 61 | 62 | 63 | 69 | 70 | 76 | 77 | 78 | 79 | 81 | 82 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /whereami/WhereAmICommand.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WhereAmICommand.swift 3 | // whereami 4 | // 5 | // Created by Victor Jalencas on 14/12/14. 6 | // Copyright (c) 2014 Hand Forged. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | import CoreLocation 12 | 13 | 14 | let MaxLocationFixStaleness = 10.0 15 | 16 | enum OutputFormat { 17 | case Json 18 | case Bare 19 | case Sexagesimal 20 | } 21 | 22 | class WhereAmICommand: Command, CLLocationManagerDelegate { 23 | var locationObtained = false 24 | var errorOccurred = false 25 | var location = CLLocationCoordinate2DMake(0, 0) 26 | var errorMessage = "" 27 | 28 | var format = OutputFormat.Bare 29 | 30 | 31 | func locationManager(manager: CLLocationManager!, didUpdateLocations locations: [AnyObject]!) { 32 | 33 | // the last one will be the most recent 34 | let updatedLocation = locations.last as! CLLocation; 35 | 36 | // Check is not older than 10 seconds, otherwise discard it 37 | if (updatedLocation.timestamp.timeIntervalSinceNow < MaxLocationFixStaleness) { 38 | location = updatedLocation.coordinate; 39 | locationObtained = true; 40 | CFRunLoopStop(CFRunLoopGetCurrent()); 41 | } 42 | 43 | } 44 | 45 | func locationManager(manager: CLLocationManager!, didFailWithError error: NSError!) { 46 | if (error.domain == kCLErrorDomain) { 47 | switch (CLError(rawValue: error.code)!) { 48 | case .LocationUnknown: 49 | errorMessage = "Could not determine your location. Perhaps your WiFi is disabled?" 50 | case .Denied: 51 | errorMessage = "Denied Permission" 52 | default: 53 | errorMessage = "Unspecified error" 54 | } 55 | } 56 | 57 | errorOccurred = true; 58 | CFRunLoopStop(CFRunLoopGetCurrent()); 59 | } 60 | 61 | func display(CLLocationCoordinate2D) -> () { 62 | var outputString: String 63 | switch (self.format) { 64 | case .Json: 65 | outputString = "{\"latitude\":\(location.latitude), \"longitude\": \(location.longitude)}" 66 | case .Sexagesimal: 67 | outputString = "\(stringFromDegrees(location.latitude)), \(stringFromDegrees(location.longitude))" 68 | case .Bare: 69 | outputString = "\(location.latitude),\(location.longitude)" 70 | } 71 | println(outputString); 72 | 73 | } 74 | 75 | 76 | // MARK: - Aux function 77 | 78 | func stringFromDegrees(degrees: Double) -> String { 79 | 80 | var deg: Double 81 | var min: Double 82 | var sec: Double 83 | 84 | (deg, min) = modf(degrees) 85 | min = min * 60 86 | (min, sec) = modf(min) 87 | sec = sec * 60 88 | 89 | return "\(Int(deg))° \(Int(min))′ \(sec)″" 90 | 91 | } 92 | // MARK: - Overrides 93 | 94 | override func commandName() -> String { 95 | return "" 96 | } 97 | 98 | override func execute() -> ExecutionResult { 99 | switch CLLocationManager.authorizationStatus() { 100 | case .Restricted: 101 | errorMessage = "You don't have permission to use Location Services."; 102 | errorOccurred = true; 103 | case .Denied: 104 | errorMessage = "You denied permission to use Location Services, please enable it in Preferences."; 105 | errorOccurred = true; 106 | default: 107 | if (!CLLocationManager.locationServicesEnabled()) { 108 | errorMessage = "Location Services are not enabled for this computer, please enable them in Preferences."; 109 | errorOccurred = true; 110 | } 111 | } 112 | 113 | var status: Int32 = 0 114 | if (!errorOccurred) { 115 | 116 | let manager = CLLocationManager(); 117 | manager.delegate = self; 118 | manager.startUpdatingLocation(); 119 | 120 | status = CFRunLoopRunInMode(kCFRunLoopDefaultMode, 15, 0) 121 | } 122 | 123 | if (errorOccurred) { 124 | return failure(errorMessage); 125 | } else if (status == Int32(kCFRunLoopRunTimedOut)) { 126 | return failure("Could not get a proper location fix in 15 seconds. Try again perhaps?") 127 | } else { 128 | display(location); 129 | } 130 | 131 | return success(); 132 | } 133 | 134 | override func handleOptions() { 135 | self.onKey("--format", 136 | usage:"output format (bare (default), json, sexagesimal)", 137 | valueSignature: "formatName", 138 | block: {key, value in 139 | switch (value) { 140 | case "json": 141 | self.format = .Json 142 | case "sexagesimal": 143 | self.format = .Sexagesimal 144 | default: 145 | self.format = .Bare 146 | } 147 | }) 148 | } 149 | } -------------------------------------------------------------------------------- /whereami.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 5729EF6F1B050DFE008BB71D /* CommandArguments.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5729EF5A1B050DFE008BB71D /* CommandArguments.swift */; }; 11 | 5729EF701B050DFE008BB71D /* Options.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5729EF5B1B050DFE008BB71D /* Options.swift */; }; 12 | 5729EF711B050DFE008BB71D /* RawArguments.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5729EF5C1B050DFE008BB71D /* RawArguments.swift */; }; 13 | 5729EF721B050DFE008BB71D /* CLI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5729EF5E1B050DFE008BB71D /* CLI.swift */; }; 14 | 5729EF731B050DFE008BB71D /* CommandSignature.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5729EF5F1B050DFE008BB71D /* CommandSignature.swift */; }; 15 | 5729EF741B050DFE008BB71D /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5729EF601B050DFE008BB71D /* Extensions.swift */; }; 16 | 5729EF751B050DFE008BB71D /* Router.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5729EF611B050DFE008BB71D /* Router.swift */; }; 17 | 5729EF761B050DFE008BB71D /* ChainableCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5729EF641B050DFE008BB71D /* ChainableCommand.swift */; }; 18 | 5729EF771B050DFE008BB71D /* Command.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5729EF651B050DFE008BB71D /* Command.swift */; }; 19 | 5729EF781B050DFE008BB71D /* LightweightCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5729EF661B050DFE008BB71D /* LightweightCommand.swift */; }; 20 | 5729EF791B050DFE008BB71D /* HelpCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5729EF681B050DFE008BB71D /* HelpCommand.swift */; }; 21 | 5729EF7A1B050DFE008BB71D /* VersionCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5729EF691B050DFE008BB71D /* VersionCommand.swift */; }; 22 | 5729EF7B1B050DFE008BB71D /* Input.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5729EF6B1B050DFE008BB71D /* Input.swift */; }; 23 | 5729EF7C1B050DFE008BB71D /* Output.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5729EF6C1B050DFE008BB71D /* Output.swift */; }; 24 | 5729EF7D1B050DFE008BB71D /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5729EF6E1B050DFE008BB71D /* Result.swift */; }; 25 | 5740DE7A19B66AB2007DB96C /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5740DE7919B66AB2007DB96C /* main.swift */; }; 26 | 57A6F51D1A3E371A0059F83B /* WhereAmICommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57A6F51C1A3E371A0059F83B /* WhereAmICommand.swift */; }; 27 | 57A6F5211A3E46F30059F83B /* WAIVersionCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57A6F5201A3E46F30059F83B /* WAIVersionCommand.swift */; }; 28 | /* End PBXBuildFile section */ 29 | 30 | /* Begin PBXCopyFilesBuildPhase section */ 31 | 5740DE7419B66AB2007DB96C /* CopyFiles */ = { 32 | isa = PBXCopyFilesBuildPhase; 33 | buildActionMask = 2147483647; 34 | dstPath = /usr/share/man/man1/; 35 | dstSubfolderSpec = 0; 36 | files = ( 37 | ); 38 | runOnlyForDeploymentPostprocessing = 1; 39 | }; 40 | /* End PBXCopyFilesBuildPhase section */ 41 | 42 | /* Begin PBXFileReference section */ 43 | 5729EF5A1B050DFE008BB71D /* CommandArguments.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CommandArguments.swift; sourceTree = ""; }; 44 | 5729EF5B1B050DFE008BB71D /* Options.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Options.swift; sourceTree = ""; }; 45 | 5729EF5C1B050DFE008BB71D /* RawArguments.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RawArguments.swift; sourceTree = ""; }; 46 | 5729EF5E1B050DFE008BB71D /* CLI.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CLI.swift; sourceTree = ""; }; 47 | 5729EF5F1B050DFE008BB71D /* CommandSignature.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CommandSignature.swift; sourceTree = ""; }; 48 | 5729EF601B050DFE008BB71D /* Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; 49 | 5729EF611B050DFE008BB71D /* Router.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Router.swift; sourceTree = ""; }; 50 | 5729EF641B050DFE008BB71D /* ChainableCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChainableCommand.swift; sourceTree = ""; }; 51 | 5729EF651B050DFE008BB71D /* Command.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Command.swift; sourceTree = ""; }; 52 | 5729EF661B050DFE008BB71D /* LightweightCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LightweightCommand.swift; sourceTree = ""; }; 53 | 5729EF681B050DFE008BB71D /* HelpCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HelpCommand.swift; sourceTree = ""; }; 54 | 5729EF691B050DFE008BB71D /* VersionCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VersionCommand.swift; sourceTree = ""; }; 55 | 5729EF6B1B050DFE008BB71D /* Input.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Input.swift; sourceTree = ""; }; 56 | 5729EF6C1B050DFE008BB71D /* Output.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Output.swift; sourceTree = ""; }; 57 | 5729EF6E1B050DFE008BB71D /* Result.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Result.swift; sourceTree = ""; }; 58 | 5740DE7619B66AB2007DB96C /* whereami */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = whereami; sourceTree = BUILT_PRODUCTS_DIR; }; 59 | 5740DE7919B66AB2007DB96C /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; 60 | 57A6F51C1A3E371A0059F83B /* WhereAmICommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WhereAmICommand.swift; sourceTree = ""; }; 61 | 57A6F5201A3E46F30059F83B /* WAIVersionCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WAIVersionCommand.swift; sourceTree = ""; }; 62 | 57DE650819B8BA020032578E /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = whereami/Info.plist; sourceTree = ""; }; 63 | /* End PBXFileReference section */ 64 | 65 | /* Begin PBXFrameworksBuildPhase section */ 66 | 5740DE7319B66AB2007DB96C /* Frameworks */ = { 67 | isa = PBXFrameworksBuildPhase; 68 | buildActionMask = 2147483647; 69 | files = ( 70 | ); 71 | runOnlyForDeploymentPostprocessing = 0; 72 | }; 73 | /* End PBXFrameworksBuildPhase section */ 74 | 75 | /* Begin PBXGroup section */ 76 | 5729EF581B050DFE008BB71D /* SwiftCLI */ = { 77 | isa = PBXGroup; 78 | children = ( 79 | 5729EF591B050DFE008BB71D /* Arguments */, 80 | 5729EF5D1B050DFE008BB71D /* CLI */, 81 | 5729EF621B050DFE008BB71D /* Commands */, 82 | 5729EF6A1B050DFE008BB71D /* IO */, 83 | 5729EF6D1B050DFE008BB71D /* Result */, 84 | ); 85 | name = SwiftCLI; 86 | path = SwiftCLI/SwiftCLI; 87 | sourceTree = ""; 88 | }; 89 | 5729EF591B050DFE008BB71D /* Arguments */ = { 90 | isa = PBXGroup; 91 | children = ( 92 | 5729EF5A1B050DFE008BB71D /* CommandArguments.swift */, 93 | 5729EF5B1B050DFE008BB71D /* Options.swift */, 94 | 5729EF5C1B050DFE008BB71D /* RawArguments.swift */, 95 | ); 96 | path = Arguments; 97 | sourceTree = ""; 98 | }; 99 | 5729EF5D1B050DFE008BB71D /* CLI */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | 5729EF5E1B050DFE008BB71D /* CLI.swift */, 103 | 5729EF5F1B050DFE008BB71D /* CommandSignature.swift */, 104 | 5729EF601B050DFE008BB71D /* Extensions.swift */, 105 | 5729EF611B050DFE008BB71D /* Router.swift */, 106 | ); 107 | path = CLI; 108 | sourceTree = ""; 109 | }; 110 | 5729EF621B050DFE008BB71D /* Commands */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | 5729EF631B050DFE008BB71D /* Base */, 114 | 5729EF671B050DFE008BB71D /* Special */, 115 | ); 116 | path = Commands; 117 | sourceTree = ""; 118 | }; 119 | 5729EF631B050DFE008BB71D /* Base */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | 5729EF641B050DFE008BB71D /* ChainableCommand.swift */, 123 | 5729EF651B050DFE008BB71D /* Command.swift */, 124 | 5729EF661B050DFE008BB71D /* LightweightCommand.swift */, 125 | ); 126 | path = Base; 127 | sourceTree = ""; 128 | }; 129 | 5729EF671B050DFE008BB71D /* Special */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | 5729EF681B050DFE008BB71D /* HelpCommand.swift */, 133 | 5729EF691B050DFE008BB71D /* VersionCommand.swift */, 134 | ); 135 | path = Special; 136 | sourceTree = ""; 137 | }; 138 | 5729EF6A1B050DFE008BB71D /* IO */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | 5729EF6B1B050DFE008BB71D /* Input.swift */, 142 | 5729EF6C1B050DFE008BB71D /* Output.swift */, 143 | ); 144 | path = IO; 145 | sourceTree = ""; 146 | }; 147 | 5729EF6D1B050DFE008BB71D /* Result */ = { 148 | isa = PBXGroup; 149 | children = ( 150 | 5729EF6E1B050DFE008BB71D /* Result.swift */, 151 | ); 152 | path = Result; 153 | sourceTree = ""; 154 | }; 155 | 5740DE6D19B66AB2007DB96C = { 156 | isa = PBXGroup; 157 | children = ( 158 | 5740DE7819B66AB2007DB96C /* whereami */, 159 | 5740DE7719B66AB2007DB96C /* Products */, 160 | ); 161 | sourceTree = ""; 162 | }; 163 | 5740DE7719B66AB2007DB96C /* Products */ = { 164 | isa = PBXGroup; 165 | children = ( 166 | 5740DE7619B66AB2007DB96C /* whereami */, 167 | ); 168 | name = Products; 169 | sourceTree = ""; 170 | }; 171 | 5740DE7819B66AB2007DB96C /* whereami */ = { 172 | isa = PBXGroup; 173 | children = ( 174 | 5729EF581B050DFE008BB71D /* SwiftCLI */, 175 | 57DE650719B8A8020032578E /* Supporting Files */, 176 | 5740DE7919B66AB2007DB96C /* main.swift */, 177 | 57A6F51C1A3E371A0059F83B /* WhereAmICommand.swift */, 178 | 57A6F5201A3E46F30059F83B /* WAIVersionCommand.swift */, 179 | ); 180 | path = whereami; 181 | sourceTree = ""; 182 | }; 183 | 57DE650719B8A8020032578E /* Supporting Files */ = { 184 | isa = PBXGroup; 185 | children = ( 186 | 57DE650819B8BA020032578E /* Info.plist */, 187 | ); 188 | name = "Supporting Files"; 189 | path = ..; 190 | sourceTree = ""; 191 | }; 192 | /* End PBXGroup section */ 193 | 194 | /* Begin PBXNativeTarget section */ 195 | 5740DE7519B66AB2007DB96C /* whereami */ = { 196 | isa = PBXNativeTarget; 197 | buildConfigurationList = 5740DE7D19B66AB2007DB96C /* Build configuration list for PBXNativeTarget "whereami" */; 198 | buildPhases = ( 199 | 5740DE7219B66AB2007DB96C /* Sources */, 200 | 5740DE7319B66AB2007DB96C /* Frameworks */, 201 | 5740DE7419B66AB2007DB96C /* CopyFiles */, 202 | ); 203 | buildRules = ( 204 | ); 205 | dependencies = ( 206 | ); 207 | name = whereami; 208 | productName = whereami; 209 | productReference = 5740DE7619B66AB2007DB96C /* whereami */; 210 | productType = "com.apple.product-type.tool"; 211 | }; 212 | /* End PBXNativeTarget section */ 213 | 214 | /* Begin PBXProject section */ 215 | 5740DE6E19B66AB2007DB96C /* Project object */ = { 216 | isa = PBXProject; 217 | attributes = { 218 | LastUpgradeCheck = 0600; 219 | ORGANIZATIONNAME = "Hand Forged"; 220 | TargetAttributes = { 221 | 5740DE7519B66AB2007DB96C = { 222 | CreatedOnToolsVersion = 6.0; 223 | }; 224 | }; 225 | }; 226 | buildConfigurationList = 5740DE7119B66AB2007DB96C /* Build configuration list for PBXProject "whereami" */; 227 | compatibilityVersion = "Xcode 3.2"; 228 | developmentRegion = English; 229 | hasScannedForEncodings = 0; 230 | knownRegions = ( 231 | en, 232 | ); 233 | mainGroup = 5740DE6D19B66AB2007DB96C; 234 | productRefGroup = 5740DE7719B66AB2007DB96C /* Products */; 235 | projectDirPath = ""; 236 | projectRoot = ""; 237 | targets = ( 238 | 5740DE7519B66AB2007DB96C /* whereami */, 239 | ); 240 | }; 241 | /* End PBXProject section */ 242 | 243 | /* Begin PBXSourcesBuildPhase section */ 244 | 5740DE7219B66AB2007DB96C /* Sources */ = { 245 | isa = PBXSourcesBuildPhase; 246 | buildActionMask = 2147483647; 247 | files = ( 248 | 5729EF7D1B050DFE008BB71D /* Result.swift in Sources */, 249 | 5729EF7C1B050DFE008BB71D /* Output.swift in Sources */, 250 | 5729EF7A1B050DFE008BB71D /* VersionCommand.swift in Sources */, 251 | 57A6F5211A3E46F30059F83B /* WAIVersionCommand.swift in Sources */, 252 | 5729EF741B050DFE008BB71D /* Extensions.swift in Sources */, 253 | 5729EF751B050DFE008BB71D /* Router.swift in Sources */, 254 | 5729EF781B050DFE008BB71D /* LightweightCommand.swift in Sources */, 255 | 5729EF761B050DFE008BB71D /* ChainableCommand.swift in Sources */, 256 | 5729EF7B1B050DFE008BB71D /* Input.swift in Sources */, 257 | 57A6F51D1A3E371A0059F83B /* WhereAmICommand.swift in Sources */, 258 | 5729EF731B050DFE008BB71D /* CommandSignature.swift in Sources */, 259 | 5729EF6F1B050DFE008BB71D /* CommandArguments.swift in Sources */, 260 | 5729EF791B050DFE008BB71D /* HelpCommand.swift in Sources */, 261 | 5729EF721B050DFE008BB71D /* CLI.swift in Sources */, 262 | 5729EF701B050DFE008BB71D /* Options.swift in Sources */, 263 | 5740DE7A19B66AB2007DB96C /* main.swift in Sources */, 264 | 5729EF711B050DFE008BB71D /* RawArguments.swift in Sources */, 265 | 5729EF771B050DFE008BB71D /* Command.swift in Sources */, 266 | ); 267 | runOnlyForDeploymentPostprocessing = 0; 268 | }; 269 | /* End PBXSourcesBuildPhase section */ 270 | 271 | /* Begin XCBuildConfiguration section */ 272 | 5740DE7B19B66AB2007DB96C /* Debug */ = { 273 | isa = XCBuildConfiguration; 274 | buildSettings = { 275 | ALWAYS_SEARCH_USER_PATHS = NO; 276 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 277 | CLANG_CXX_LIBRARY = "libc++"; 278 | CLANG_ENABLE_MODULES = YES; 279 | CLANG_ENABLE_OBJC_ARC = YES; 280 | CLANG_WARN_BOOL_CONVERSION = YES; 281 | CLANG_WARN_CONSTANT_CONVERSION = YES; 282 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 283 | CLANG_WARN_EMPTY_BODY = YES; 284 | CLANG_WARN_ENUM_CONVERSION = YES; 285 | CLANG_WARN_INT_CONVERSION = YES; 286 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 287 | CLANG_WARN_UNREACHABLE_CODE = YES; 288 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 289 | COPY_PHASE_STRIP = NO; 290 | CREATE_INFOPLIST_SECTION_IN_BINARY = NO; 291 | ENABLE_STRICT_OBJC_MSGSEND = YES; 292 | GCC_C_LANGUAGE_STANDARD = gnu99; 293 | GCC_DYNAMIC_NO_PIC = NO; 294 | GCC_OPTIMIZATION_LEVEL = 0; 295 | GCC_PREPROCESSOR_DEFINITIONS = ( 296 | "DEBUG=1", 297 | "$(inherited)", 298 | ); 299 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 300 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 301 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 302 | GCC_WARN_UNDECLARED_SELECTOR = YES; 303 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 304 | GCC_WARN_UNUSED_FUNCTION = YES; 305 | GCC_WARN_UNUSED_VARIABLE = YES; 306 | MACOSX_DEPLOYMENT_TARGET = 10.9; 307 | MTL_ENABLE_DEBUG_INFO = YES; 308 | ONLY_ACTIVE_ARCH = YES; 309 | OTHER_LDFLAGS = ""; 310 | SDKROOT = macosx; 311 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 312 | }; 313 | name = Debug; 314 | }; 315 | 5740DE7C19B66AB2007DB96C /* Release */ = { 316 | isa = XCBuildConfiguration; 317 | buildSettings = { 318 | ALWAYS_SEARCH_USER_PATHS = NO; 319 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 320 | CLANG_CXX_LIBRARY = "libc++"; 321 | CLANG_ENABLE_MODULES = YES; 322 | CLANG_ENABLE_OBJC_ARC = YES; 323 | CLANG_WARN_BOOL_CONVERSION = YES; 324 | CLANG_WARN_CONSTANT_CONVERSION = YES; 325 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 326 | CLANG_WARN_EMPTY_BODY = YES; 327 | CLANG_WARN_ENUM_CONVERSION = YES; 328 | CLANG_WARN_INT_CONVERSION = YES; 329 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 330 | CLANG_WARN_UNREACHABLE_CODE = YES; 331 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 332 | COPY_PHASE_STRIP = YES; 333 | CREATE_INFOPLIST_SECTION_IN_BINARY = NO; 334 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 335 | DEPLOYMENT_POSTPROCESSING = YES; 336 | DSTROOT = /; 337 | ENABLE_NS_ASSERTIONS = NO; 338 | ENABLE_STRICT_OBJC_MSGSEND = YES; 339 | GCC_C_LANGUAGE_STANDARD = gnu99; 340 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 341 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 342 | GCC_WARN_UNDECLARED_SELECTOR = YES; 343 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 344 | GCC_WARN_UNUSED_FUNCTION = YES; 345 | GCC_WARN_UNUSED_VARIABLE = YES; 346 | MACOSX_DEPLOYMENT_TARGET = 10.9; 347 | MTL_ENABLE_DEBUG_INFO = NO; 348 | OTHER_LDFLAGS = ""; 349 | SDKROOT = macosx; 350 | }; 351 | name = Release; 352 | }; 353 | 5740DE7E19B66AB2007DB96C /* Debug */ = { 354 | isa = XCBuildConfiguration; 355 | buildSettings = { 356 | OTHER_LDFLAGS = ( 357 | "-sectcreate", 358 | __TEXT, 359 | __info_plist, 360 | whereami/Info.plist, 361 | ); 362 | PRODUCT_NAME = "$(TARGET_NAME)"; 363 | }; 364 | name = Debug; 365 | }; 366 | 5740DE7F19B66AB2007DB96C /* Release */ = { 367 | isa = XCBuildConfiguration; 368 | buildSettings = { 369 | OTHER_LDFLAGS = ( 370 | "-sectcreate", 371 | __TEXT, 372 | __info_plist, 373 | whereami/Info.plist, 374 | ); 375 | PRODUCT_NAME = "$(TARGET_NAME)"; 376 | }; 377 | name = Release; 378 | }; 379 | /* End XCBuildConfiguration section */ 380 | 381 | /* Begin XCConfigurationList section */ 382 | 5740DE7119B66AB2007DB96C /* Build configuration list for PBXProject "whereami" */ = { 383 | isa = XCConfigurationList; 384 | buildConfigurations = ( 385 | 5740DE7B19B66AB2007DB96C /* Debug */, 386 | 5740DE7C19B66AB2007DB96C /* Release */, 387 | ); 388 | defaultConfigurationIsVisible = 0; 389 | defaultConfigurationName = Release; 390 | }; 391 | 5740DE7D19B66AB2007DB96C /* Build configuration list for PBXNativeTarget "whereami" */ = { 392 | isa = XCConfigurationList; 393 | buildConfigurations = ( 394 | 5740DE7E19B66AB2007DB96C /* Debug */, 395 | 5740DE7F19B66AB2007DB96C /* Release */, 396 | ); 397 | defaultConfigurationIsVisible = 0; 398 | defaultConfigurationName = Release; 399 | }; 400 | /* End XCConfigurationList section */ 401 | }; 402 | rootObject = 5740DE6E19B66AB2007DB96C /* Project object */; 403 | } 404 | --------------------------------------------------------------------------------