mirror of
https://github.com/nsomar/Swiftline.git
synced 2024-09-11 05:35:42 +03:00
Adding EnvsAndArgs swift example
This commit is contained in:
parent
cc7a52279e
commit
24b021eb77
19
Examples/EnvAndArgs.swift
Normal file
19
Examples/EnvAndArgs.swift
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env xcrun swift -F ./Rome/ -framework Swiftline
|
||||||
|
|
||||||
|
import Swiftline
|
||||||
|
|
||||||
|
|
||||||
|
// print(Env.get("PWD")!)
|
||||||
|
print("All Environment Variables")
|
||||||
|
print(Env.keys.joinWithSeparator("\n"))
|
||||||
|
|
||||||
|
print("\nPrinting value of PWD")
|
||||||
|
print(Env.get("PWD")!)
|
||||||
|
|
||||||
|
print("\nPrint all Arguments")
|
||||||
|
print(Args.all)
|
||||||
|
|
||||||
|
print("\nPrint parsed Arguments")
|
||||||
|
print(Args.parsed.flags["target"]!)
|
||||||
|
print(Args.parsed.flags["framework"]!)
|
||||||
|
print(Args.parsed.parameters)
|
Loading…
Reference in New Issue
Block a user