Skip to content

Commit 3770ab8

Browse files
committed
Integrate GBCli
1 parent 5a7ede5 commit 3770ab8

File tree

6 files changed

+213
-50
lines changed

6 files changed

+213
-50
lines changed

MacDown.xcodeproj/project.pbxproj

+64-14
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
1F4C8E9A194AE0B9004BF82E /* MarkdownDocument.icns in Resources */ = {isa = PBXBuildFile; fileRef = 1F4C8E99194AE0B9004BF82E /* MarkdownDocument.icns */; };
3636
1F51C9A5194565050015A96F /* MPPreferencesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1FCDCA311944F96E00B1F966 /* MPPreferencesTests.m */; };
3737
1F64CCC9195F5AB900CE619A /* MPAsset.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F64CCC8195F5AB900CE619A /* MPAsset.m */; };
38+
1F8858BC1A2D8D82008DC543 /* MPArgumentProcessor.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F8858BB1A2D8D82008DC543 /* MPArgumentProcessor.m */; };
3839
1F8A82D919533E9300B6BF69 /* Prism in Resources */ = {isa = PBXBuildFile; fileRef = 1F8A82D819533E9300B6BF69 /* Prism */; };
3940
1F8A835D1953454F00B6BF69 /* HGMarkdownHighlighter.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F8A83581953454F00B6BF69 /* HGMarkdownHighlighter.m */; settings = {COMPILER_FLAGS = "-Xanalyzer -analyzer-disable-checker"; }; };
4041
1F8A835E1953454F00B6BF69 /* HGMarkdownHighlightingStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F8A835A1953454F00B6BF69 /* HGMarkdownHighlightingStyle.m */; };
@@ -68,26 +69,27 @@
6869
1FFEB32B19737D6E00B2254F /* YAMLSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = 1FFEB32A19737D6E00B2254F /* YAMLSerialization.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc -Wno-unused-variable"; }; };
6970
1FFF301D1948A5320009AF24 /* MPStringLookupTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1FFF301C1948A5320009AF24 /* MPStringLookupTests.m */; };
7071
5318159056384894AA42DB4F /* libPods-MacDownTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AEAF42BBDCEC4012B5092BB3 /* libPods-MacDownTests.a */; };
72+
5807564D5F35BA9758A64530 /* libPods-macdown-cmd.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4AFCF7AEBCE081BD528ABC3D /* libPods-macdown-cmd.a */; };
7173
905EF1A9196164CA00FC3CE9 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 905EF1A8196164CA00FC3CE9 /* Foundation.framework */; };
7274
905EF1B7196164F300FC3CE9 /* macdown in Copy command line utility */ = {isa = PBXBuildFile; fileRef = 905EF1A7196164CA00FC3CE9 /* macdown */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
7375
B49728377A904875B2963C38 /* libPods-MacDown.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7C5C1FBBB3ED456285901D31 /* libPods-MacDown.a */; };
7476
/* End PBXBuildFile section */
7577

7678
/* Begin PBXContainerItemProxy section */
79+
1F4574781A2D87D500DFA5FF /* PBXContainerItemProxy */ = {
80+
isa = PBXContainerItemProxy;
81+
containerPortal = 1FCD71131A20BA3A00C028B5 /* version.xcodeproj */;
82+
proxyType = 1;
83+
remoteGlobalIDString = 1FCD710D1A20BA3A00C028B5;
84+
remoteInfo = version;
85+
};
7786
1FA6DE491941CC9E000409FB /* PBXContainerItemProxy */ = {
7887
isa = PBXContainerItemProxy;
7988
containerPortal = 1FA6DE191941CC9E000409FB /* Project object */;
8089
proxyType = 1;
8190
remoteGlobalIDString = 1FA6DE201941CC9E000409FB;
8291
remoteInfo = MarkPad;
8392
};
84-
1FCD71171A20BB6B00C028B5 /* PBXContainerItemProxy */ = {
85-
isa = PBXContainerItemProxy;
86-
containerPortal = 1FCD71131A20BA3A00C028B5 /* version.xcodeproj */;
87-
proxyType = 1;
88-
remoteGlobalIDString = 1FCD710D1A20BA3A00C028B5;
89-
remoteInfo = version;
90-
};
9193
1FE2197719534A5D00DB931F /* PBXContainerItemProxy */ = {
9294
isa = PBXContainerItemProxy;
9395
containerPortal = 1F8A837E195348C500B6BF69 /* peg-markdown-highlight.xcodeproj */;
@@ -173,6 +175,9 @@
173175
1F64CCC7195F5AB900CE619A /* MPAsset.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPAsset.h; sourceTree = "<group>"; };
174176
1F64CCC8195F5AB900CE619A /* MPAsset.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPAsset.m; sourceTree = "<group>"; };
175177
1F70CCD81978F03E00703429 /* MPAutosaving.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MPAutosaving.h; sourceTree = "<group>"; };
178+
1F8858BA1A2D8D82008DC543 /* MPArgumentProcessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MPArgumentProcessor.h; path = "macdown-cmd/MPArgumentProcessor.h"; sourceTree = SOURCE_ROOT; };
179+
1F8858BB1A2D8D82008DC543 /* MPArgumentProcessor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MPArgumentProcessor.m; path = "macdown-cmd/MPArgumentProcessor.m"; sourceTree = SOURCE_ROOT; };
180+
1F8858BD1A2D8ED4008DC543 /* MPGlobals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MPGlobals.h; path = "macdown-cmd/MPGlobals.h"; sourceTree = SOURCE_ROOT; };
176181
1F8A82D819533E9300B6BF69 /* Prism */ = {isa = PBXFileReference; lastKnownFileType = folder; name = Prism; path = Resources/Prism; sourceTree = "<group>"; };
177182
1F8A83571953454F00B6BF69 /* HGMarkdownHighlighter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HGMarkdownHighlighter.h; path = "Dependency/peg-markdown-highlight/HGMarkdownHighlighter.h"; sourceTree = SOURCE_ROOT; };
178183
1F8A83581953454F00B6BF69 /* HGMarkdownHighlighter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HGMarkdownHighlighter.m; path = "Dependency/peg-markdown-highlight/HGMarkdownHighlighter.m"; sourceTree = SOURCE_ROOT; };
@@ -226,13 +231,16 @@
226231
1FFEB32A19737D6E00B2254F /* YAMLSerialization.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YAMLSerialization.m; sourceTree = "<group>"; };
227232
1FFF301C1948A5320009AF24 /* MPStringLookupTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPStringLookupTests.m; sourceTree = "<group>"; };
228233
481332E4A369446F177A8DF0 /* Pods-MacDown.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MacDown.release.xcconfig"; path = "Pods/Target Support Files/Pods-MacDown/Pods-MacDown.release.xcconfig"; sourceTree = "<group>"; };
234+
4AFCF7AEBCE081BD528ABC3D /* libPods-macdown-cmd.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-macdown-cmd.a"; sourceTree = BUILT_PRODUCTS_DIR; };
235+
632F686FDE66C78EBA2ABB7B /* Pods-macdown-cmd.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-macdown-cmd.debug.xcconfig"; path = "Pods/Target Support Files/Pods-macdown-cmd/Pods-macdown-cmd.debug.xcconfig"; sourceTree = "<group>"; };
229236
7C5C1FBBB3ED456285901D31 /* libPods-MacDown.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-MacDown.a"; sourceTree = BUILT_PRODUCTS_DIR; };
230237
905EF1A7196164CA00FC3CE9 /* macdown */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = macdown; sourceTree = BUILT_PRODUCTS_DIR; };
231238
905EF1A8196164CA00FC3CE9 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
232239
A9105A2DE3384B0DB400BAD1 /* Pods-MacDown.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MacDown.debug.xcconfig"; path = "Pods/Target Support Files/Pods-MacDown/Pods-MacDown.debug.xcconfig"; sourceTree = "<group>"; };
233240
AEAF42BBDCEC4012B5092BB3 /* libPods-MacDownTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-MacDownTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
234241
BDCDF2E157FE72C2ED7438DD /* Pods-MacDownTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MacDownTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-MacDownTests/Pods-MacDownTests.release.xcconfig"; sourceTree = "<group>"; };
235242
E352E0A2562DCE60302D805E /* Pods-MacDownTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MacDownTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-MacDownTests/Pods-MacDownTests.debug.xcconfig"; sourceTree = "<group>"; };
243+
E87590C145FF88E3F084D54C /* Pods-macdown-cmd.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-macdown-cmd.release.xcconfig"; path = "Pods/Target Support Files/Pods-macdown-cmd/Pods-macdown-cmd.release.xcconfig"; sourceTree = "<group>"; };
236244
/* End PBXFileReference section */
237245

238246
/* Begin PBXFrameworksBuildPhase section */
@@ -262,6 +270,7 @@
262270
buildActionMask = 2147483647;
263271
files = (
264272
905EF1A9196164CA00FC3CE9 /* Foundation.framework in Frameworks */,
273+
5807564D5F35BA9758A64530 /* libPods-macdown-cmd.a in Frameworks */,
265274
);
266275
runOnlyForDeploymentPostprocessing = 0;
267276
};
@@ -456,6 +465,7 @@
456465
1FA6DE261941CC9E000409FB /* Other Frameworks */,
457466
7C5C1FBBB3ED456285901D31 /* libPods-MacDown.a */,
458467
AEAF42BBDCEC4012B5092BB3 /* libPods-MacDownTests.a */,
468+
4AFCF7AEBCE081BD528ABC3D /* libPods-macdown-cmd.a */,
459469
);
460470
name = Frameworks;
461471
sourceTree = "<group>";
@@ -551,9 +561,12 @@
551561
905EF1AA196164CA00FC3CE9 /* macdown-cmd */ = {
552562
isa = PBXGroup;
553563
children = (
554-
1FCD711A1A20BE2F00C028B5 /* version.h */,
555564
1F2A17261A1BB3E30055A107 /* NSUserDefaults+Suite.h */,
556565
1F2A17271A1BB3E30055A107 /* NSUserDefaults+Suite.m */,
566+
1FCD711A1A20BE2F00C028B5 /* version.h */,
567+
1F8858BD1A2D8ED4008DC543 /* MPGlobals.h */,
568+
1F8858BA1A2D8D82008DC543 /* MPArgumentProcessor.h */,
569+
1F8858BB1A2D8D82008DC543 /* MPArgumentProcessor.m */,
557570
1FBE8E0E1A11DB1E003E1EF4 /* main.m */,
558571
);
559572
name = "macdown-cmd";
@@ -567,6 +580,8 @@
567580
481332E4A369446F177A8DF0 /* Pods-MacDown.release.xcconfig */,
568581
E352E0A2562DCE60302D805E /* Pods-MacDownTests.debug.xcconfig */,
569582
BDCDF2E157FE72C2ED7438DD /* Pods-MacDownTests.release.xcconfig */,
583+
632F686FDE66C78EBA2ABB7B /* Pods-macdown-cmd.debug.xcconfig */,
584+
E87590C145FF88E3F084D54C /* Pods-macdown-cmd.release.xcconfig */,
570585
);
571586
name = Pods;
572587
sourceTree = "<group>";
@@ -622,14 +637,16 @@
622637
isa = PBXNativeTarget;
623638
buildConfigurationList = 905EF1B3196164CA00FC3CE9 /* Build configuration list for PBXNativeTarget "macdown-cmd" */;
624639
buildPhases = (
640+
8354BB1F574EFC071D91C89B /* Check Pods Manifest.lock */,
625641
905EF1A3196164CA00FC3CE9 /* Sources */,
626642
905EF1A4196164CA00FC3CE9 /* Frameworks */,
627643
905EF1A5196164CA00FC3CE9 /* CopyFiles */,
644+
38BEB4F8BD690E8970217D44 /* Copy Pods Resources */,
628645
);
629646
buildRules = (
630647
);
631648
dependencies = (
632-
1FCD71181A20BB6B00C028B5 /* PBXTargetDependency */,
649+
1F4574791A2D87D500DFA5FF /* PBXTargetDependency */,
633650
);
634651
name = "macdown-cmd";
635652
productName = "MacDown-cmd";
@@ -753,6 +770,21 @@
753770
shellScript = "SOURCE=$PWD/Dependency/prism\nTARGET=$PWD/MacDown/Resources/Prism\ncp -r $SOURCE/components $TARGET\ncp -r $SOURCE/themes $TARGET\ncp -r $SOURCE/components.js $TARGET";
754771
showEnvVarsInLog = 0;
755772
};
773+
38BEB4F8BD690E8970217D44 /* Copy Pods Resources */ = {
774+
isa = PBXShellScriptBuildPhase;
775+
buildActionMask = 2147483647;
776+
files = (
777+
);
778+
inputPaths = (
779+
);
780+
name = "Copy Pods Resources";
781+
outputPaths = (
782+
);
783+
runOnlyForDeploymentPostprocessing = 0;
784+
shellPath = /bin/sh;
785+
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-macdown-cmd/Pods-macdown-cmd-resources.sh\"\n";
786+
showEnvVarsInLog = 0;
787+
};
756788
46C28C219A3C4CCD94797747 /* Copy Pods Resources */ = {
757789
isa = PBXShellScriptBuildPhase;
758790
buildActionMask = 2147483647;
@@ -798,6 +830,21 @@
798830
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-MacDownTests/Pods-MacDownTests-resources.sh\"\n";
799831
showEnvVarsInLog = 0;
800832
};
833+
8354BB1F574EFC071D91C89B /* Check Pods Manifest.lock */ = {
834+
isa = PBXShellScriptBuildPhase;
835+
buildActionMask = 2147483647;
836+
files = (
837+
);
838+
inputPaths = (
839+
);
840+
name = "Check Pods Manifest.lock";
841+
outputPaths = (
842+
);
843+
runOnlyForDeploymentPostprocessing = 0;
844+
shellPath = /bin/sh;
845+
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
846+
showEnvVarsInLog = 0;
847+
};
801848
A4C68C7905CF45C89A0CC47D /* Check Pods Manifest.lock */ = {
802849
isa = PBXShellScriptBuildPhase;
803850
buildActionMask = 2147483647;
@@ -863,6 +910,7 @@
863910
isa = PBXSourcesBuildPhase;
864911
buildActionMask = 2147483647;
865912
files = (
913+
1F8858BC1A2D8D82008DC543 /* MPArgumentProcessor.m in Sources */,
866914
1FBE8E0F1A11DB1E003E1EF4 /* main.m in Sources */,
867915
1F2A17281A1BB3E30055A107 /* NSUserDefaults+Suite.m in Sources */,
868916
);
@@ -871,16 +919,16 @@
871919
/* End PBXSourcesBuildPhase section */
872920

873921
/* Begin PBXTargetDependency section */
922+
1F4574791A2D87D500DFA5FF /* PBXTargetDependency */ = {
923+
isa = PBXTargetDependency;
924+
name = version;
925+
targetProxy = 1F4574781A2D87D500DFA5FF /* PBXContainerItemProxy */;
926+
};
874927
1FA6DE4A1941CC9E000409FB /* PBXTargetDependency */ = {
875928
isa = PBXTargetDependency;
876929
target = 1FA6DE201941CC9E000409FB /* MacDown */;
877930
targetProxy = 1FA6DE491941CC9E000409FB /* PBXContainerItemProxy */;
878931
};
879-
1FCD71181A20BB6B00C028B5 /* PBXTargetDependency */ = {
880-
isa = PBXTargetDependency;
881-
name = version;
882-
targetProxy = 1FCD71171A20BB6B00C028B5 /* PBXContainerItemProxy */;
883-
};
884932
1FE2197819534A5D00DB931F /* PBXTargetDependency */ = {
885933
isa = PBXTargetDependency;
886934
name = "peg-markdown-highlight";
@@ -1148,6 +1196,7 @@
11481196
};
11491197
905EF1B1196164CA00FC3CE9 /* Debug */ = {
11501198
isa = XCBuildConfiguration;
1199+
baseConfigurationReference = 632F686FDE66C78EBA2ABB7B /* Pods-macdown-cmd.debug.xcconfig */;
11511200
buildSettings = {
11521201
GCC_PRECOMPILE_PREFIX_HEADER = YES;
11531202
GCC_PREFIX_HEADER = "";
@@ -1161,6 +1210,7 @@
11611210
};
11621211
905EF1B2196164CA00FC3CE9 /* Release */ = {
11631212
isa = XCBuildConfiguration;
1213+
baseConfigurationReference = E87590C145FF88E3F084D54C /* Pods-macdown-cmd.release.xcconfig */;
11641214
buildSettings = {
11651215
GCC_PRECOMPILE_PREFIX_HEADER = YES;
11661216
GCC_PREFIX_HEADER = "";

Podfile

+3
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,6 @@ target "MacDownTests" do
1818
pod 'PAPreferences'
1919
end
2020

21+
target "macdown-cmd" do
22+
pod 'GBCli'
23+
end

macdown-cmd/MPArgumentProcessor.h

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//
2+
// MPArgumentProcessor.h
3+
// MacDown
4+
//
5+
// Created by Tzu-ping Chung on 02/12.
6+
// Copyright (c) 2014 Tzu-ping Chung . All rights reserved.
7+
//
8+
9+
#import <Foundation/Foundation.h>
10+
11+
@interface MPArgumentProcessor : NSObject
12+
13+
- (instancetype)init;
14+
15+
@property (nonatomic, assign, readonly) BOOL printsHelp;
16+
@property (nonatomic, assign, readonly) BOOL printsVersion;
17+
@property (nonatomic, strong, readonly) NSArray *arguments;
18+
19+
- (void)printHelp:(BOOL)shouldExit;
20+
- (void)printVersion:(BOOL)shouldExit;
21+
22+
@end

macdown-cmd/MPArgumentProcessor.m

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
//
2+
// MPArgumentProcessor.m
3+
// MacDown
4+
//
5+
// Created by Tzu-ping Chung on 02/12.
6+
// Copyright (c) 2014 Tzu-ping Chung . All rights reserved.
7+
//
8+
9+
#import "MPArgumentProcessor.h"
10+
#import <GBCli/GBCli.h>
11+
#import "MPGlobals.h"
12+
13+
14+
@interface MPArgumentProcessor ()
15+
16+
@property (strong) GBCommandLineParser *parser;
17+
@property (strong) GBOptionsHelper *options;
18+
@property (strong) GBSettings *settings;
19+
20+
@end
21+
22+
23+
@implementation MPArgumentProcessor
24+
25+
- (instancetype)init
26+
{
27+
self = [super init];
28+
if (!self)
29+
return nil;
30+
31+
// Init options.
32+
GBOptionsHelper *options = [[GBOptionsHelper alloc] init];
33+
options.applicationVersion = ^{
34+
return [NSString stringWithUTF8String:kMPApplicationShortVersion];
35+
};
36+
options.applicationBuild = ^{
37+
return [NSString stringWithUTF8String:kMPApplicationBundleVersion];
38+
};
39+
options.applicationName = ^{ return kMPApplicationName; };
40+
options.printHelpHeader = ^{
41+
NSString *fmt =
42+
@"usage: %@ version [option] ... file [file ...]\n\nOptions:";
43+
return [NSString stringWithFormat:fmt, kMPCommandName];
44+
};
45+
[options registerOption:'v' long:kMPVersionKey
46+
description:@"Print the version and exit."
47+
flags:GBOptionNoValue];
48+
[options registerOption:'h' long:kMPHelpKey
49+
description:@"Print this help message and exit."
50+
flags:GBOptionNoValue];
51+
self.options = options;
52+
53+
self.settings = [[GBSettings alloc] initWithName:@"command-line"
54+
parent:nil];
55+
56+
// Create parser and parse.
57+
GBCommandLineParser *parser = [[GBCommandLineParser alloc] init];
58+
[parser registerSettings:self.settings];
59+
[parser registerOptions:self.options];
60+
self.parser = parser;
61+
62+
[self.parser parseOptionsUsingDefaultArguments];
63+
64+
return self;
65+
}
66+
67+
- (BOOL)printsHelp
68+
{
69+
return [self.settings boolForKey:kMPHelpKey];
70+
}
71+
72+
- (BOOL)printsVersion
73+
{
74+
return [self.settings boolForKey:kMPVersionKey];
75+
}
76+
77+
- (NSArray *)arguments
78+
{
79+
return self.parser.arguments;
80+
}
81+
82+
- (void)printHelp:(BOOL)shouldExit
83+
{
84+
[self.options printHelp];
85+
if (shouldExit)
86+
exit(EXIT_SUCCESS);
87+
}
88+
89+
- (void)printVersion:(BOOL)shouldExit
90+
{
91+
[self.options printVersion];
92+
if (shouldExit)
93+
exit(EXIT_SUCCESS);
94+
}
95+
96+
@end

macdown-cmd/MPGlobals.h

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//
2+
// MPGlobals.h
3+
// MacDown
4+
//
5+
// Created by Tzu-ping Chung on 02/12.
6+
// Copyright (c) 2014 Tzu-ping Chung . All rights reserved.
7+
//
8+
9+
#import "version.h"
10+
11+
// These should match the main bundle's values.
12+
static NSString * const kMPApplicationName = @"MacDown";
13+
static NSString * const kMPApplicationSuiteName = @"com.uranusjr.macdown";
14+
15+
static NSString * const kMPCommandName = @"macdown";
16+
17+
static NSString * const kMPHelpKey = @"help";
18+
static NSString * const kMPVersionKey = @"version";

0 commit comments

Comments
 (0)