mirror of
https://github.com/mas-cli/mas
synced 2024-11-21 19:23:01 +00:00
commit
e98e42f1b6
6 changed files with 26 additions and 8 deletions
|
@ -67,7 +67,7 @@ public final class ArgumentParser {
|
|||
rawArguments.append(contentsOf: options.map { arg in
|
||||
if arg.hasPrefix("-") {
|
||||
// Do we have `--{key}` or `-{flags}`.
|
||||
let opt = arg.characters.dropFirst()
|
||||
let opt = arg.dropFirst()
|
||||
if opt.first == "-" {
|
||||
return .key(String(opt.dropFirst()))
|
||||
} else {
|
||||
|
|
|
@ -46,10 +46,10 @@ public struct HelpCommand<ClientError: Error>: CommandProtocol {
|
|||
|
||||
print("Available commands:\n")
|
||||
|
||||
let maxVerbLength = self.registry.commands.map { $0.verb.characters.count }.max() ?? 0
|
||||
let maxVerbLength = self.registry.commands.map { $0.verb.count }.max() ?? 0
|
||||
|
||||
for command in self.registry.commands {
|
||||
let padding = repeatElement(Character(" "), count: maxVerbLength - command.verb.characters.count)
|
||||
let padding = repeatElement(Character(" "), count: maxVerbLength - command.verb.count)
|
||||
print(" \(command.verb)\(String(padding)) \(command.function)")
|
||||
}
|
||||
|
||||
|
|
|
@ -307,12 +307,12 @@
|
|||
attributes = {
|
||||
LastSwiftMigration = 0730;
|
||||
LastSwiftUpdateCheck = 0700;
|
||||
LastUpgradeCheck = 0830;
|
||||
LastUpgradeCheck = 0920;
|
||||
ORGANIZATIONNAME = "Andrew Naylor";
|
||||
TargetAttributes = {
|
||||
ED031A771B5127C00097692E = {
|
||||
CreatedOnToolsVersion = 7.0;
|
||||
LastSwiftMigration = 0800;
|
||||
LastSwiftMigration = 0920;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -391,14 +391,20 @@
|
|||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
|
@ -438,14 +444,20 @@
|
|||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
|
@ -483,6 +495,8 @@
|
|||
PRODUCT_BUNDLE_IDENTIFIER = "com.mphys.mas-cli";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "mas-cli/mas-cli-Bridging-Header.h";
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = On;
|
||||
SWIFT_VERSION = 4.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
|
@ -502,6 +516,8 @@
|
|||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "mas-cli/mas-cli-Bridging-Header.h";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = On;
|
||||
SWIFT_VERSION = 4.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0830"
|
||||
LastUpgradeVersion = "0920"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
@ -26,6 +26,7 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
|
@ -45,6 +46,7 @@
|
|||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
language = ""
|
||||
launchStyle = "1"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
|
|
|
@ -24,7 +24,7 @@ struct InstallCommand: CommandProtocol {
|
|||
|
||||
switch downloadResults.count {
|
||||
case 0:
|
||||
return .success()
|
||||
return .success(())
|
||||
case 1:
|
||||
return .failure(downloadResults[0])
|
||||
default:
|
||||
|
|
|
@ -42,7 +42,7 @@ struct UpgradeCommand: CommandProtocol {
|
|||
|
||||
switch updateResults.count {
|
||||
case 0:
|
||||
return .success()
|
||||
return .success(())
|
||||
case 1:
|
||||
return .failure(updateResults[0])
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue