summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2021-12-04 18:03:41 +0100
committerTom Smeding <tom@tomsmeding.com>2021-12-04 18:03:41 +0100
commitd72da4a04692311952f03781dac9a4343447aa74 (patch)
tree11bfb622a66b4f9800f888db99a3ddc98995a655
parente0632dd35e0dd6491397514d09ad273f4d1e0392 (diff)
Allow 'c' argument for auto-paste
-rw-r--r--2021/Input.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/2021/Input.hs b/2021/Input.hs
index afce44e..be95b9b 100644
--- a/2021/Input.hs
+++ b/2021/Input.hs
@@ -2,6 +2,7 @@ module Input where
import System.Environment
import System.IO
+import System.Process
getInput :: Int -> IO [String]
@@ -12,6 +13,7 @@ getInput day = do
str <- case args of
["-"] -> getContents
[] -> readFile fname
+ ["c"] -> readProcess "xsel" ["-bo"] ""
_ -> do
hPutStrLn stderr $ "WARNING: Unrecognised command-line parameters " ++ show args ++
", reading from " ++ fname