Skip to content

Commit

Permalink
ogma-cli: Modify component spec command to allow customizing target f…
Browse files Browse the repository at this point in the history
…ilename. Refs #80.

Ogma does not allow users to specify the name of the target file that should be
used in applications produced from FRET files. Without that extra facility, it
becomes necessary to rename and modify the Copilot/Haskell (or C) files
produced, which detracts from a smooth UX process.

This commit modifies the top-level command-line interface to include a new flag
for the fret-component-spec command, allowing users to customize the name of
the target C filenames generated by Copilot.
  • Loading branch information
ivanperez-keera committed May 21, 2023
1 parent 8f372b1 commit 71c6dcf
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ogma-cli/src/CLI/CommandFretComponentSpec2Copilot.hs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ data CommandOpts = CommandOpts
, fretComponentSpecCoCoSpec :: Bool
, fretComponentSpecIntType :: String
, fretComponentSpecRealType :: String
, fretComponentSpecTarget :: String
}

-- | Transform a FRET component specification into a Copilot specification.
Expand All @@ -80,6 +81,7 @@ command c =
{ fretCS2CopilotUseCoCoSpec = fretComponentSpecCoCoSpec c
, fretCS2CopilotIntType = fretComponentSpecIntType c
, fretCS2CopilotRealType = fretComponentSpecRealType c
, fretCS2CopilotFilename = fretComponentSpecTarget c
}

-- * CLI
Expand Down Expand Up @@ -118,6 +120,13 @@ commandOptsParser = CommandOpts
<> showDefault
<> value "Float"
)
<*> strOption
( long "target-file-name"
<> metavar "FILENAME"
<> help strFretTargetDesc
<> showDefault
<> value "fret"
)

-- | Argument FRET command description
strFretArgDesc :: String
Expand All @@ -134,3 +143,7 @@ strFretIntTypeDesc = "Map integer variables to the given type"
-- | Real type mapping flag description.
strFretRealTypeDesc :: String
strFretRealTypeDesc = "Map real variables to the given type"

-- | Target file name flag description.
strFretTargetDesc :: String
strFretTargetDesc = "Filename prefix for monitoring files in target language"

0 comments on commit 71c6dcf

Please sign in to comment.