@@ -199,15 +199,6 @@ profileCommand = (,)
199199 <> showDefault
200200 ))
201201
202−
203−--TODO: Result should provide normalised path and also original user input for error reporting.
204−thunkDirectoryParser :: Parser FilePath
205−thunkDirectoryParser = fmap (dropTrailingPathSeparator . normalise) . strArgument $ mconcat
206− [ action "directory"
207− , metavar "THUNKDIR"
208− , help "Path to directory containing thunk data"
209− ]
210−
211202thunkConfig :: Parser ThunkConfig
212203thunkConfig = ThunkConfig
213204 <$>
@@ -240,13 +231,19 @@ data ThunkCommand
240231
241232thunkOption :: Parser ThunkOption
242233thunkOption = hsubparser $ mconcat
243− [ command "update" $ info (thunkOptionWith $ ThunkCommand_Update <$> thunkUpdateConfig) $ progDesc "Update thunk to latest revision available"
234+ [ command "update" $ info (thunkOptionWith $ ThunkCommand_Update <$> thunkUpdateConfig) $ progDesc "Update packed thunk to latest revision available on the tracked branch"
244235 , command "unpack" $ info (thunkOptionWith $ pure ThunkCommand_Unpack) $ progDesc "Unpack thunk into git checkout of revision it points to"
245− , command "pack" $ info (thunkOptionWith $ ThunkCommand_Pack <$> thunkPackConfig) $ progDesc "Pack git checkout into thunk that points at the current branch's upstream"
246− , command "init" $ info (thunkOptionWith $ pure ThunkCommand_Init) $ progDesc "Initialize a git checkout by converting it to an unpacked thunk"
236+ , command "pack" $ info (thunkOptionWith $ ThunkCommand_Pack <$> thunkPackConfig) $ progDesc "Pack git checkout or unpacked thunk into thunk that points at the current branch's upstream"
237+ , command "init" $ info (thunkOptionWith $ pure ThunkCommand_Init) $ progDesc "Initialize git checkout by converting it to an unpacked thunk"
247238 ]
248239 where
249− thunkOptionWith f = ThunkOption <$> NonEmpty.some1 thunkDirectoryParser <*> f
240+ thunkOptionWith f = ThunkOption
241+ <$> ((NonEmpty.:|)
242+ <$> thunkDirArg (metavar "THUNKDIRS..." <> help "Paths to directories containing thunk data")
243+ <*> many (thunkDirArg mempty)
244+ )
245+ <*> f
246+ thunkDirArg opts = fmap (dropTrailingPathSeparator . normalise) $ strArgument $ action "directory" <> opts
250247
251248data ShellOpts
252249 = ShellOpts