Skip to content

Commit

Permalink
Add linux support
Browse files Browse the repository at this point in the history
  • Loading branch information
kylef committed Dec 4, 2015
1 parent 0e49462 commit 6ef6363
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Sources/ArgumentParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ public final class ArgumentParser : ArgumentConvertible, CustomStringConvertible
/// Initialises the ArgumentParser with an array of arguments
public init(arguments: [String]) {
self.arguments = arguments.map { argument in
if argument.hasPrefix("-") {
if argument.characters.first == "-" {
let flags = argument[argument.startIndex.successor()..<argument.endIndex]

if flags.hasPrefix("-") {
if flags.characters.first == "-" {
let option = flags[flags.startIndex.successor()..<flags.endIndex]
return .Option(option)
}
Expand Down
7 changes: 6 additions & 1 deletion Sources/CommandDarwin.swift → Sources/CommandRunner.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import Darwin.libc
#if os(Linux)
import Glibc
#else
import Darwin.libc
#endif


/// Extensions to CommandType to provide convinience running methods for CLI tools
extension CommandType {
Expand Down

0 comments on commit 6ef6363

Please sign in to comment.