aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/Main.hs13
1 files changed, 12 insertions, 1 deletions
diff --git a/app/Main.hs b/app/Main.hs
index e3c1a28..351bcac 100644
--- a/app/Main.hs
+++ b/app/Main.hs
@@ -1,7 +1,12 @@
+{-# LANGUAGE OverloadedStrings #-}
+
module Main where
+import Data.ByteString.Lazy (ByteString)
+import Data.ByteString.Lazy qualified as LB
import Options.Applicative ((<**>))
import Options.Applicative qualified as O
+import System.Process.Typed qualified as P
data Options = Options
{ optCommand :: Command
@@ -36,4 +41,10 @@ showCommandParser =
main :: IO ()
main = do
options <- O.execParser (O.info (commandParser <**> O.helper) O.idm)
- print options
+ files <- getFiles
+ print files
+
+getFiles :: IO [ByteString]
+getFiles =
+ fmap (LB.split 10 . snd) $
+ P.readProcessStdout "git ls-files --cached --exclude-standard --other"