@@ -16,8 +16,6 @@ import Data.List
1616import qualified Data.Text as T
1717import Data.Text.Encoding
1818import Data.Text.Encoding.Error (lenientDecode)
19−import Data.Time.Clock
20−import Data.Time.Format (formatTime, defaultTimeLocale)
2119import GHC.StaticPtr
2220import Options.Applicative
2321import Options.Applicative.Help.Pretty (text, (<$$>))
@@ -89,7 +87,7 @@ data ObCommand
8987 = ObCommand_Init InitSource Bool
9088 | ObCommand_Deploy DeployCommand
9189 | ObCommand_Run
92− | ObCommand_Profile (Maybe FilePath) String
90+ | ObCommand_Profile String [String]
9391 | ObCommand_Thunk ThunkCommand
9492 | ObCommand_Repl
9593 | ObCommand_Watch
@@ -111,7 +109,7 @@ obCommand cfg = hsubparser
111109 [ command "init" $ info (ObCommand_Init <$> initSource <*> initForce) $ progDesc "Initialize an Obelisk project"
112110 , command "deploy" $ info (ObCommand_Deploy <$> deployCommand cfg) $ progDesc "Prepare a deployment for an Obelisk project"
113111 , command "run" $ info (pure ObCommand_Run) $ progDesc "Run current project in development mode"
114− , command "profile" $ info (ObCommand_Profile <$> (optional (strOption (long "output" <> short 'o' <> help "Base output to use for profiling output. Suffixes are added to this based on the profiling type. Defaults to a timestamped path in the profile/ directory in the project's root." <> metavar "PATH"))) <*> (strOption (long "rts-flags" <> help "RTS Flags to pass to the executable." <> value "-p -hc" <> metavar "FLAGS" <> showDefault))) $ progDesc "Run current project with profiling enabled"
112+ , command "profile" $ info (ObCommand_Profile <$> (strOption (long "output" <> short 'o' <> help "Base output to use for profiling output. Suffixes are added to this based on the profiling type. Defaults to a timestamped path in the profile/ directory in the project's root." <> metavar "PATH" <> value "profile/%Y-%m-%dT%H:%M:%S" <> showDefault)) <*> (words <$> strOption (long "rts-flags" <> help "RTS Flags to pass to the executable." <> value "-p -hc" <> metavar "FLAGS" <> showDefault))) $ progDesc "Run current project with profiling enabled"
115113 , command "thunk" $ info (ObCommand_Thunk <$> thunkCommand) $ progDesc "Manipulate thunk directories"
116114 , command "repl" $ info (pure ObCommand_Repl) $ progDesc "Open an interactive interpreter"
117115 , command "watch" $ info (pure ObCommand_Watch) $ progDesc "Watch current project for errors and warnings"
@@ -370,13 +368,7 @@ ob = \case
370368 DeployCommand_Update -> deployUpdate "."
371369 DeployCommand_Test (platform, extraArgs) -> deployMobile platform extraArgs
372370 ObCommand_Run -> run
373− ObCommand_Profile mBasePath rtsFlags -> do
374− basePath <- case mBasePath of
375− Just path -> pure path
376− Nothing -> do
377− time <- liftIO $ getCurrentTime
378− pure $ "profile" </> formatTime defaultTimeLocale "%Y-%m-%dT%H:%M:%S" time
379− profile basePath rtsFlags
371+ ObCommand_Profile basePath rtsFlags -> profile basePath rtsFlags
380372 ObCommand_Thunk tc -> case tc of
381373 ThunkCommand_Update thunks config -> for_ thunks (updateThunkToLatest config)
382374 ThunkCommand_Unpack thunks -> for_ thunks unpackThunk