shift 0.2.0.3 → 0.2.1.0
raw patch · 3 files changed
+12/−9 lines, 3 filessetup-changed
Files
- Setup.hs +0/−2
- shift.cabal +2/−3
- src/Teleport.hs +10/−4
− Setup.hs
@@ -1,2 +0,0 @@-import Distribution.Simple-main = defaultMain
shift.cabal view
@@ -1,13 +1,12 @@ cabal-version: >=1.10 name: shift-version: 0.2.0.3+version: 0.2.1.0 license: MIT license-file: LICENSE-copyright: 2010 Siddharth Bhat, 2017 Vanessa McHale+copyright: 2010 Siddharth Bhat, 2017-2018 Vanessa McHale maintainer: vamchale@gmail.com author: Siddharth Bhat, Vanessa McHale stability: unstable-homepage: https://github.com/vmchale/teleport#readme bug-reports: https://github.com/vmchale/teleport/issues synopsis: A tool to quickly switch between directories description:
src/Teleport.hs view
@@ -27,18 +27,19 @@ import System.Environment import Turtle hiding (find, header, (&)) --- | options for 'warp add' data AddOptions = AddOptions { folderPath :: Maybe String, addname :: String } --- | options for 'warp remove' newtype RemoveOptions = RemoveOptions { removename :: String } --- | options for 'warp goto' newtype GotoOptions = GotoOptions { gotoname :: String } -- | data type for command-data Command = Display | Add AddOptions | Remove RemoveOptions | Goto GotoOptions+data Command = Display+ | Add AddOptions+ | Remove RemoveOptions+ | Goto GotoOptions+ | Replace String -- an abstract entity representing a point to which we can warp to data WarpPoint = WarpPoint { _name :: String@@ -108,11 +109,15 @@ parseGotoCommand :: Parser Command parseGotoCommand = Goto . GotoOptions <$> warpnameParser +parseReplaceCommand :: Parser Command+parseReplaceCommand = Replace <$> warpnameParser+ parseCommand :: Parser Command parseCommand = hsubparser (command "add" (info parseAddCommand (progDesc "add a warp point")) <> command "list" (info (pure Display) (progDesc "list all warp points")) <> command "del" (info parseRemoveCommand (progDesc "delete a warp point"))+ <> command "replace" (info parseReplaceCommand (progDesc "replace a warp point")) <> command "to" (info parseGotoCommand (progDesc "go to a created warp point"))) setErrorColor :: IO ()@@ -201,4 +206,5 @@ run (Add addOpt) = runAdd addOpt run Display = runDisplay run (Remove removeOpt) = runRemove removeOpt+run (Replace str) = runRemove (RemoveOptions str) *> runAdd (AddOptions Nothing str) run (Goto gotoOpt) = runGoto gotoOpt