Skip to content

Commit

Permalink
ogma-cli: Introduce argument to customize target directory in standal…
Browse files Browse the repository at this point in the history
…one command. Refs nasa#189.
  • Loading branch information
ivanperez-keera committed Dec 11, 2024
1 parent 6849281 commit 9ae9ba4
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions ogma-cli/src/CLI/CommandStandalone.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ import qualified Command.Standalone

-- | Options to generate Copilot from specification.
data CommandOpts = CommandOpts
{ standaloneFileName :: FilePath
{ standaloneTargetDir :: FilePath
, standaloneFileName :: FilePath
, standaloneFormat :: String
, standalonePropFormat :: String
, standaloneTypes :: [String]
Expand All @@ -71,7 +72,8 @@ command c = standalone (standaloneFileName c) internalCommandOpts
where
internalCommandOpts :: Command.Standalone.StandaloneOptions
internalCommandOpts = Command.Standalone.StandaloneOptions
{ Command.Standalone.standaloneFormat = standaloneFormat c
{ Command.Standalone.standaloneTargetDir = standaloneTargetDir c
, Command.Standalone.standaloneFormat = standaloneFormat c
, Command.Standalone.standalonePropFormat = standalonePropFormat c
, Command.Standalone.standaloneTypeMapping = types
, Command.Standalone.standaloneFilename = standaloneTarget c
Expand All @@ -98,6 +100,13 @@ commandDesc =
commandOptsParser :: Parser CommandOpts
commandOptsParser = CommandOpts
<$> strOption
( long "target-dir"
<> metavar "DIR"
<> showDefault
<> value "copilot"
<> help strStandaloneTargetDirDesc
)
<*> strOption
( long "file-name"
<> metavar "FILENAME"
<> help strStandaloneFilenameDesc
Expand Down Expand Up @@ -154,6 +163,10 @@ strStandaloneTargetDesc :: String
strStandaloneTargetDesc =
"Filename prefix for monitoring files in target language"

-- | Target dir flag description.
strStandaloneTargetDirDesc :: String
strStandaloneTargetDirDesc = "Target directory"

-- * Error codes

-- | Encoding of reasons why the command can fail.
Expand Down

0 comments on commit 9ae9ba4

Please sign in to comment.