Skip to content

Commit abacf97

Browse files
committed
Merge pull request #3 from ypopovych/master
version command
2 parents 2748d66 + 81e28fa commit abacf97

File tree

4 files changed

+41
-1
lines changed

4 files changed

+41
-1
lines changed

swift-express.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
9692AE211C5A535400DD9F5C /* Commandant.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9692AE1D1C5A4BA100DD9F5C /* Commandant.framework */; };
3333
9692AE221C5A535400DD9F5C /* Commandant.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9692AE1D1C5A4BA100DD9F5C /* Commandant.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
3434
9692AE241C5A535400DD9F5C /* Result.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9692AE1E1C5A4BA100DD9F5C /* Result.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
35+
969CFAFE1C6570670009A663 /* Version.swift in Sources */ = {isa = PBXBuildFile; fileRef = 969CFAFD1C6570670009A663 /* Version.swift */; };
3536
96CCD7C61C5A6B8200E503E0 /* SubTask.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96CCD7C51C5A6B8200E503E0 /* SubTask.swift */; };
3637
96CCD7C81C5A788D00E503E0 /* Git.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96CCD7C71C5A788D00E503E0 /* Git.swift */; };
3738
/* End PBXBuildFile section */
@@ -90,6 +91,7 @@
9091
968A3BCF1C63AF7300E4AFCC /* Run.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Run.swift; sourceTree = "<group>"; };
9192
9692AE1D1C5A4BA100DD9F5C /* Commandant.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Commandant.framework; path = Carthage/Build/Mac/Commandant.framework; sourceTree = "<group>"; };
9293
9692AE1E1C5A4BA100DD9F5C /* Result.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Result.framework; path = Carthage/Build/Mac/Result.framework; sourceTree = "<group>"; };
94+
969CFAFD1C6570670009A663 /* Version.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Version.swift; sourceTree = "<group>"; };
9395
96CCD7C51C5A6B8200E503E0 /* SubTask.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SubTask.swift; sourceTree = "<group>"; };
9496
96CCD7C71C5A788D00E503E0 /* Git.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Git.swift; sourceTree = "<group>"; };
9597
/* End PBXFileReference section */
@@ -197,6 +199,7 @@
197199
967383DF1C596718002E27A3 /* Init */,
198200
968A3BCD1C63AF5A00E4AFCC /* Build.swift */,
199201
968A3BCF1C63AF7300E4AFCC /* Run.swift */,
202+
969CFAFD1C6570670009A663 /* Version.swift */,
200203
);
201204
path = Commands;
202205
sourceTree = "<group>";
@@ -336,6 +339,7 @@
336339
960A22EA1C641725005DE6B1 /* Signal.swift in Sources */,
337340
963488871C5F981A000D152F /* FindXcodeProject.swift in Sources */,
338341
967383E11C59672F002E27A3 /* Init.swift in Sources */,
342+
969CFAFE1C6570670009A663 /* Version.swift in Sources */,
339343
96860A5F1C5A893B006DBC55 /* FileOperations.swift in Sources */,
340344
9634888B1C5F9878000D152F /* CarthageInstallLibs.swift in Sources */,
341345
967383E31C5979D1002E27A3 /* Step.swift in Sources */,

swift-express/Commands/Version.swift

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
//===--- Version.swift --------------------------------------------------------===//
2+
//Copyright (c) 2015-2016 Daniel Leping (dileping)
3+
//
4+
//This file is part of Swift Express Command Line
5+
//
6+
//Swift Express Command Line is free software: you can redistribute it and/or modify
7+
//it under the terms of the GNU General Public License as published by
8+
//the Free Software Foundation, either version 3 of the License, or
9+
//(at your option) any later version.
10+
//
11+
//Swift Express Command Line is distributed in the hope that it will be useful,
12+
//but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
//GNU General Public License for more details.
15+
//
16+
//You should have received a copy of the GNU General Public License
17+
//along with Swift Express Command Line. If not, see <http://www.gnu.org/licenses/>.
18+
//
19+
//===---------------------------------------------------------------------------===//
20+
21+
import Commandant
22+
import Result
23+
24+
struct VersionCommand: CommandType {
25+
let verb = "version"
26+
let function = "Display the current version of Swift Express Command Line"
27+
28+
func run(options: NoOptions<SwiftExpressError>) -> Result<(), SwiftExpressError> {
29+
#if os(OSX)
30+
print("Swift Express Command Line \(NSBundle.mainBundle().infoDictionary!["CFBundleShortVersionString"]!)")
31+
#endif
32+
return .Success(())
33+
}
34+
}
35+

swift-express/Core/SwiftExpress.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ func commandRegistry() -> CommandRegistry<SwiftExpressError> {
3333
registry.register(InitCommand())
3434
registry.register(BuildCommand())
3535
registry.register(RunCommand())
36+
registry.register(VersionCommand())
3637

3738
let helpCommand = HelpCommand(registry: registry)
3839
registry.register(helpCommand)

swift-express/Resources/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>1.0</string>
20+
<string>0.1.2</string>
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleVersion</key>

0 commit comments

Comments
 (0)