added stdInput and shell options
This commit is contained in:
@@ -37,7 +37,7 @@ main = do
|
|||||||
|
|
||||||
let execProcP2PrcParser = execProcP2PrcParser_ p2prcCmd
|
let execProcP2PrcParser = execProcP2PrcParser_ p2prcCmd
|
||||||
|
|
||||||
outputStr <- execProcP2PrcParser [MkOptAtomic "-ls"] MkEmpty :: IOEitherError IPAdressTable
|
outputStr <- execProcP2PrcParser [MkOptAtomic "-ls"] MkEmptyStdInput :: IOEitherError IPAdressTable
|
||||||
print outputStr
|
print outputStr
|
||||||
|
|
||||||
terminateProcess startProcessHandle
|
terminateProcess startProcessHandle
|
||||||
@@ -81,8 +81,8 @@ data ServerInfo = MkServerInfo
|
|||||||
, latency :: Int
|
, latency :: Int
|
||||||
, download :: Int
|
, download :: Int
|
||||||
, upload :: Int
|
, upload :: Int
|
||||||
, serverPort :: Int -- TODO: verify if it is Maybe value
|
, serverPort :: Int
|
||||||
, bareMetalSSHPort :: Maybe Int -- TODO: verify if it is Maybe value
|
, bareMetalSSHPort :: Maybe Int
|
||||||
, nat :: Bool
|
, nat :: Bool
|
||||||
, escapeImplementation :: Maybe T.Text
|
, escapeImplementation :: Maybe T.Text
|
||||||
, customInformation :: Maybe T.Text
|
, customInformation :: Maybe T.Text
|
||||||
@@ -144,10 +144,12 @@ instance FromJSON ServerInfo where
|
|||||||
|
|
||||||
|
|
||||||
data StdInput
|
data StdInput
|
||||||
= MkEmpty
|
= MkEmptyStdInput
|
||||||
|
| MkStdInputVal String
|
||||||
|
|
||||||
instance Show StdInput where
|
instance Show StdInput where
|
||||||
show MkEmpty = ""
|
show MkEmptyStdInput = ""
|
||||||
|
show (MkStdInputVal v) = show v
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -175,7 +177,8 @@ execProcP2Prc_ p2prcCmd ops stdi =
|
|||||||
|
|
||||||
|
|
||||||
data CLIOpt
|
data CLIOpt
|
||||||
= MkOptAtomic String
|
= MkEmptyOpts
|
||||||
|
| MkOptAtomic String
|
||||||
| MkOptTuple (String, String)
|
| MkOptTuple (String, String)
|
||||||
|
|
||||||
type CLIOptsInput = [String]
|
type CLIOptsInput = [String]
|
||||||
@@ -186,7 +189,8 @@ optsToCLI = concatMap _optToCLI
|
|||||||
where
|
where
|
||||||
|
|
||||||
_optToCLI :: CLIOpt -> CLIOptsInput
|
_optToCLI :: CLIOpt -> CLIOptsInput
|
||||||
_optToCLI (MkOptAtomic o) = [o]
|
_optToCLI MkEmptyOpts = []
|
||||||
|
_optToCLI (MkOptAtomic o) = [o]
|
||||||
_optToCLI (MkOptTuple (o, v)) = [o, show v]
|
_optToCLI (MkOptTuple (o, v)) = [o, show v]
|
||||||
|
|
||||||
|
|
||||||
@@ -215,7 +219,6 @@ sleepNSecs :: Int -> IO ()
|
|||||||
sleepNSecs i = threadDelay (i * 1000000)
|
sleepNSecs i = threadDelay (i * 1000000)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
getP2PrcCmd :: IO String
|
getP2PrcCmd :: IO String
|
||||||
getP2PrcCmd = do
|
getP2PrcCmd = do
|
||||||
|
|
||||||
@@ -229,3 +232,4 @@ getP2PrcCmd = do
|
|||||||
-- assumes that last path segment is "haskell" and that p2prc binary's name is "p2p-rendering-computation"
|
-- assumes that last path segment is "haskell" and that p2prc binary's name is "p2p-rendering-computation"
|
||||||
strip <$> readProcess "sed" ["s/haskell/p2p-rendering-computation/"] pwdOut
|
strip <$> readProcess "sed" ["s/haskell/p2p-rendering-computation/"] pwdOut
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user