Skip to content

Commit

Permalink
Add Swift Package Manager support
Browse files Browse the repository at this point in the history
  • Loading branch information
kylef committed Dec 4, 2015
1 parent 5e589eb commit 3deea58
Show file tree
Hide file tree
Showing 18 changed files with 14 additions and 42 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.conche/
/.build/
4 changes: 2 additions & 2 deletions Commander.podspec.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
"git": "https://github.com/kylef/Commander.git",
"tag": "0.3.0"
},
"source_files": "Commander/*.{h,swift}",
"source_files": "Sources/*.{h,swift}",
"platforms": {
"ios": "8.0",
"osx": "10.9"
},
"test_specification": {
"source_files": "CommanderSpecs/*Spec.swift",
"source_files": "Specs/*Spec.swift",
"dependencies": {
"Spectre": [ "~> 0.5.0" ]
}
Expand Down
7 changes: 0 additions & 7 deletions Commander/Commander.h

This file was deleted.

28 changes: 0 additions & 28 deletions Commander/Info.plist

This file was deleted.

5 changes: 5 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import PackageDescription

let package = Package(
name: "Commander"
)
File renamed without changes.
File renamed without changes.
11 changes: 6 additions & 5 deletions Commander/ArgumentParser.swift → Sources/ArgumentParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,14 @@ public final class ArgumentParser : ArgumentConvertible, CustomStringConvertible
var index = 0
for argument in arguments {
switch argument {
case .Flag(var option):
if option.contains(flag) {
option.remove(flag)
case .Flag(let option):
var options = option
if options.contains(flag) {
options.remove(flag)
arguments.removeAtIndex(index)

if !option.isEmpty {
arguments.insert(.Flag(option), atIndex: index)
if !options.isEmpty {
arguments.insert(.Flag(options), atIndex: index)
}
return true
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 3deea58

Please sign in to comment.