Skip to content

Commit

Permalink
Add init
Browse files Browse the repository at this point in the history
  • Loading branch information
KC-2001MS committed Dec 6, 2024
1 parent cb2c6cc commit 46e7b10
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 3 deletions.
18 changes: 18 additions & 0 deletions .swiftpm/xcode/xcshareddata/xcschemes/sclt.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
<PostActions>
<ExecutionAction
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Run Script"
scriptText = "# Type a script or drag a script file from your workspace to insert its path.&#10;# &#x30d1;&#x30c3;&#x30b1;&#x30fc;&#x30b8;&#x540d;&#x3092;&#x8a2d;&#x5b9a;&#10;PACKAGE_NAME=&quot;sclt&quot;&#10;&#10;# &#x30d3;&#x30eb;&#x30c9;&#x30c7;&#x30a3;&#x30ec;&#x30af;&#x30c8;&#x30ea;&#x3092;&#x8a2d;&#x5b9a;&#10;BUILD_DIR=&quot;${BUILT_PRODUCTS_DIR}&quot;&#10;&#10;# &#x5b9f;&#x884c;&#x30d5;&#x30a1;&#x30a4;&#x30eb;&#x306e;&#x30d1;&#x30b9;&#10;EXECUTABLE_PATH=&quot;$BUILD_DIR/$EXECUTABLE_PATH/$PACKAGE_NAME&quot;&#10;&#10;# &#x79fb;&#x52d5;&#x5148;&#x306e;&#x30c7;&#x30a3;&#x30ec;&#x30af;&#x30c8;&#x30ea;&#10;DEST_DIR=&quot;/usr/local/bin&quot;&#10;&#10;cp ${EXECUTABLE_PATH} ${DEST_DIR}&#10;">
<EnvironmentBuildable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "sclt"
BuildableName = "sclt"
BlueprintName = "sclt"
ReferencedContainer = "container:">
</BuildableReference>
</EnvironmentBuildable>
</ActionContent>
</ExecutionAction>
</PostActions>
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
Expand Down
21 changes: 20 additions & 1 deletion Package.resolved
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"originHash" : "c56c4d574a7bd8a5bbff82377e693afcfbc4a5d376e3c56d3aa45359bc535e7d",
"pins" : [
{
"identity" : "swift-argument-parser",
Expand Down Expand Up @@ -26,7 +27,25 @@
"revision" : "b45d1f2ed151d057b54504d653e0da5552844e34",
"version" : "1.0.0"
}
},
{
"identity" : "swift-syntax",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-syntax.git",
"state" : {
"revision" : "4c6cc0a3b9e8f14b3ae2307c5ccae4de6167ac2c",
"version" : "600.0.0-prerelease-2024-06-12"
}
},
{
"identity" : "swift-testing",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-testing.git",
"state" : {
"revision" : "69d59cfc76e5daf498ca61f5af409f594768eef9",
"version" : "0.10.0"
}
}
],
"version" : 2
"version" : 3
}
18 changes: 16 additions & 2 deletions Sources/SwiftLI/View.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import Foundation


/// View to display text in terminal
///
///
/// This is the most basic view that displays text in the terminal.
///
///
/// To display the string you want to display, declare it with the init(_ string: String) initializer.
/// ```swift
/// let text = Text("Hello SwiftLI!")
Expand Down Expand Up @@ -46,6 +46,20 @@ public struct Text: View, Sendable, Equatable {
self.contents = [String(localized: key.localizationValue, table: tableName, bundle: bundle, comment: comment)]
self.footer = false
}
/// Creates a text view that displays a string literal without localization.
/// - Parameter content: A string to display without localization.
public init(verbatim content: String) {
self.header = ""
self.contents = [content]
self.footer = false
}
/// Creates a text view that displays a string literal without localization.
/// - Parameter content: A string to display without localization.
public init<S>(_ content: S) where S : StringProtocol {
self.header = ""
self.contents = [String(content)]
self.footer = false
}
/// Creates a text view that is displayed in the terminal.
/// - Parameters:
/// - repeating: String to be repeated
Expand Down

0 comments on commit 46e7b10

Please sign in to comment.