diff --git a/app/LorentzContractsOptions.hs b/app/LorentzContractsOptions.hs index 69a5035..102e0c7 100644 --- a/app/LorentzContractsOptions.hs +++ b/app/LorentzContractsOptions.hs @@ -55,20 +55,6 @@ argParser = Opt.subparser $ mconcat , Opt.help "File to use as input." ] - printOptions = Opt.strOption $ mconcat - [ Opt.short 'n' - , Opt.long "name" - , Opt.metavar "IDENTIFIER" - , Opt.help "Name of a contract returned by `list` command." - ] - - outputOptions = optional . Opt.strOption $ mconcat - [ Opt.short 'o' - , Opt.long "output" - , Opt.metavar "FILEPATH" - , Opt.help "File to use as output. If not specified, stdout is used." - ] - baseContractOptions = optional . Opt.strOption $ mconcat [ Opt.short 'i' , Opt.long "input-contract" diff --git a/package.yaml b/package.yaml index 2642098..db4b6b4 100644 --- a/package.yaml +++ b/package.yaml @@ -2,7 +2,7 @@ <<: *meta name: lorentz-contract-param -version: 1.2.2.0.0 +version: 1.2.2.1.0 synopsis: Set of Michelson contracts implemented in Lorentz eDSL, with CLI interface description: Various contracts including simple examples. diff --git a/src/Lorentz/Contracts/Parse.hs b/src/Lorentz/Contracts/Parse.hs index 2bb9751..66e2a65 100644 --- a/src/Lorentz/Contracts/Parse.hs +++ b/src/Lorentz/Contracts/Parse.hs @@ -227,3 +227,21 @@ parseSomePublicKey = (G.SomePublicKey (Proxy @(PublicKey, PublicKey)) <$> (Opt.eitherReader (eitherDecode . fromString) <|> Opt.auto :: Opt.ReadM (PublicKey, PublicKey))) +-- | Parse which contract to print +printOptions :: Opt.Parser Text +printOptions = Opt.strOption $ mconcat + [ Opt.short 'n' + , Opt.long "name" + , Opt.metavar "IDENTIFIER" + , Opt.help "Name of a contract returned by `list` command." + ] + +-- | Parse the output `FilePath` +outputOptions :: Opt.Parser (Maybe FilePath) +outputOptions = optional . Opt.strOption $ mconcat + [ Opt.short 'o' + , Opt.long "output" + , Opt.metavar "FILEPATH" + , Opt.help "File to use as output. If not specified, stdout is used." + ] +