-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from jjotaum/feature/output-option
Added output option to support file generation as extension or struct
- Loading branch information
Showing
5 changed files
with
51 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// Output.swift | ||
// Chroma | ||
// | ||
// Created by Jota Uribe on 8/06/20. | ||
// Copyright © 2020 Jota Uribe. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import ArgumentParser | ||
|
||
enum OutputType: String, CaseIterable, ExpressibleByArgument { | ||
|
||
case `extension` | ||
case `struct` | ||
|
||
} | ||
|
||
extension OutputType { | ||
|
||
private static var formattedValues: String { | ||
return OutputType.allCases.map { "\"\($0.rawValue)\"" }.joined(separator: ",") | ||
} | ||
|
||
static var help: ArgumentHelp { | ||
""" | ||
Specifies generated file type. | ||
Supported values: \(formattedValues). | ||
""" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters