packages feed

trackit 0.5 → 0.6

raw patch · 4 files changed

+49/−43 lines, 4 filesdep ~basedep ~brickdep ~fsnotify

Dependency ranges changed: base, brick, fsnotify, mtl, optparse-generic, process, process-extras, stm, text, time

Files

LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2018, Emil Axelsson+Copyright (c) 2018-2019, Emil Axelsson  All rights reserved. 
README.md view
@@ -28,7 +28,7 @@ `trackit` starts a new buffer in the terminal and uses it to display the output of the command given as the `--command` flag. The display reacts to the following keyboard events:    * **q** - Quit `trackit`.-  * **arrow keys** - Scroll the output buffer (also with PgUp/PgDown/Home/End).+  * **arrows/vi keys** - Scroll the output buffer (also with PgUp/PgDown/Home/End). The available vi-style bindings are h/j/k/l/C-u/C-d.   * **space key** - Re-run the command and update the buffer. This is useful if no watch directory is provided, or if the output is affected by events outside of the watch directory.  When multiple changes occur in a short time in the watched directory (e.g. when switching branches in a repository), it may not be desired to have `trackit` react to every single change. This is especially the case if the monitored command is expensive (e.g. `git log` in a large repository). For this reason, `trackit` requires a *stabilization period* before running an update. If an event occurs during that period, the period clock is restarted and the update is delayed further.@@ -63,7 +63,7 @@  `trackit` only listens to `stdout` from the given command. This means that anything written to `stderr` will be ignored. In order to make sure that `stderr` is also captured, the two streams can be interleaved. This can be done by appending `2>&1` to the command (tested on Linux). -For example, the following will show an error message when run outside a Git repository:+For example, the following will show an error message when run outside of a Git repository:      > trackit -c "git status 2>&1" 
src/Main.hs view
@@ -252,18 +252,24 @@   -> AppState   -> BrickEvent View TrackitEvent   -> EventM View (Next AppState)-stepApp _ _ s (keyPressed 'q' -> True)        = halt s-stepApp _ _ s (VtyEvent (EvKey KDown []))     = theView `vScrollBy` 1 >> continue s-stepApp _ _ s (VtyEvent (EvKey KUp []))       = theView `vScrollBy` (-1) >> continue s-stepApp _ _ s (VtyEvent (EvKey KLeft []))     = withSize (\(w, _) -> theView `hScrollBy` (negate $ div w 2)) >> continue s-stepApp _ _ s (VtyEvent (EvKey KRight []))    = withSize (\(w, _) -> theView `hScrollBy` (div w 2)) >> continue s-stepApp _ _ s (VtyEvent (EvKey KHome _))      = vScrollToBeginning theView >> continue s-stepApp _ _ s (VtyEvent (EvKey KEnd _))       = vScrollToEnd theView >> continue s-stepApp _ _ s (VtyEvent (EvKey KPageUp []))   = withSize (\(_, h) -> theView `vScrollBy` (negate h)) >> continue s-stepApp _ _ s (VtyEvent (EvKey KPageDown [])) = withSize (\(_, h) -> theView `vScrollBy` h) >> continue s+stepApp _ _ s (keyPressed 'q' -> True)          = halt s stepApp _ updReq s (VtyEvent (EvKey (KChar ' ') _)) = do   liftIO $ atomically $ writeTVar updReq (Just UpdateRequest)   continue s+stepApp _ _ s (VtyEvent (EvKey kc []))+  | kc `elem` [KDown,  KChar 'j'] = theView `vScrollBy` 1 >> continue s+  | kc `elem` [KUp,    KChar 'k'] = theView `vScrollBy` (-1) >> continue s+  | kc `elem` [KLeft,  KChar 'h'] = withSize (\(w, _) -> theView `hScrollBy` (negate $ div w 2)) >> continue s+  | kc `elem` [KRight, KChar 'l'] = withSize (\(w, _) -> theView `hScrollBy` (div w 2)) >> continue s+  | kc `elem` [KHome,  KChar 'g'] = vScrollToBeginning theView >> continue s+  | kc `elem` [KEnd,   KChar 'G'] = vScrollToEnd theView >> continue s+  | kc == KPageUp                 = withSize (\(_, h) -> theView `vScrollBy` (negate h)) >> continue s+  | kc == KPageDown               = withSize (\(_, h) -> theView `vScrollBy` h) >> continue s+  | otherwise                     = continue s+stepApp _ _ s (VtyEvent (EvKey kc [MCtrl]))+  | kc == KChar 'u'               = theView `vScrollBy` (-25) >> continue s+  | kc == KChar 'd'               = theView `vScrollBy` (25) >> continue s+  | otherwise                     = continue s stepApp _ _ s (AppEvent Running) =   continue s     { commandOutput = []
trackit.cabal view
@@ -1,5 +1,5 @@ name:                trackit-version:             0.5+version:             0.6 synopsis:            A command-line tool for live monitoring description:         @trackit@ is a command-line tool that listens for changes                      in a user-supplied directory. Whenever there is a change,@@ -23,7 +23,7 @@ license-file:        LICENSE author:              Emil Axelsson maintainer:          78emil@gmail.com-copyright:           2018 Emil Axelsson+copyright:           2018-2019 Emil Axelsson homepage:            https://github.com/emilaxelsson/trackit bug-reports:         https://github.com/emilaxelsson/trackit/issues category:            Development@@ -37,32 +37,32 @@   location: https://github.com/emilaxelsson/trackit.git  executable trackit-  main-is:             Main.hs-  other-modules:       Paths_trackit-                       ParseANSI-  build-depends:       base >=4.10 && <4.13,-                       brick,-                       fsnotify,-                       mtl,-                       optparse-generic,-                       process,-                       process-extras,-                       stm,-                       text,-                       time,-                       vty-  hs-source-dirs:      src-  default-language:    Haskell2010-  default-extensions:  BangPatterns-                       DataKinds-                       DeriveGeneric-                       ExplicitNamespaces-                       FlexibleInstances-                       MultiWayIf-                       NoMonomorphismRestriction-                       OverloadedStrings-                       RecordWildCards-                       TupleSections-                       TypeOperators-                       ViewPatterns-  ghc-options:         -Wall -Wno-missing-signatures -threaded+  main-is:              Main.hs+  other-modules:        Paths_trackit+                        ParseANSI+  build-depends:        base <5+                      , brick >=0.27+                      , fsnotify >=0.2+                      , mtl >=2.2+                      , optparse-generic >=1.2+                      , process >=1.4+                      , process-extras >=0.4+                      , stm >=2.4+                      , text >=1.2+                      , time >=1.5+                      , vty+  hs-source-dirs:       src+  default-language:     Haskell2010+  default-extensions:   BangPatterns+                        DataKinds+                        DeriveGeneric+                        ExplicitNamespaces+                        FlexibleInstances+                        MultiWayIf+                        NoMonomorphismRestriction+                        OverloadedStrings+                        RecordWildCards+                        TupleSections+                        TypeOperators+                        ViewPatterns+  ghc-options:          -Wall -Wno-missing-signatures -threaded