aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/app
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2016-08-20 17:55:37 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2016-08-20 17:55:37 +0300
commitfc5ed9ff90979c077fad5cc6b6f06c6487667777 (patch)
treecf33fe64ee0ce4b7dc6a10c5eebf1f9ce270c5f4 /app
parentfix HLint warnings (diff)
downloadwindows-env-fc5ed9ff90979c077fad5cc6b6f06c6487667777.tar.gz
windows-env-fc5ed9ff90979c077fad5cc6b6f06c6487667777.zip
code style
Diffstat (limited to '')
-rw-r--r--apps/AddPath.hs25
-rw-r--r--apps/FixNtSymbolPath.hs12
-rw-r--r--apps/ListPath.hs13
-rw-r--r--apps/RemovePath.hs25
-rw-r--r--apps/SetEnv.hs24
-rw-r--r--apps/UnsetEnv.hs18
6 files changed, 61 insertions, 56 deletions
diff --git a/apps/AddPath.hs b/apps/AddPath.hs
index 1b27b84..da68009 100644
--- a/apps/AddPath.hs
+++ b/apps/AddPath.hs
@@ -30,18 +30,19 @@ optionParser = Options
<*> optGlobalDesc
<*> optPathsDesc
where
- optNameDesc = strOption $
- long "name" <> short 'n' <> metavar "NAME" <> value "PATH" <>
- help "Variable name ('PATH' by default)"
- optYesDesc = switch $
- long "yes" <> short 'y' <>
- help "Skip confirmation prompt"
- optGlobalDesc = switch $
- long "global" <> short 'g' <>
- help "Add for all users"
- optPathsDesc = many $ argument str $
- metavar "PATH" <>
- help "Directories to add"
+ optNameDesc = strOption
+ $ long "name" <> short 'n'
+ <> metavar "NAME" <> value "PATH"
+ <> help "Variable name ('PATH' by default)"
+ optYesDesc = switch
+ $ long "yes" <> short 'y'
+ <> help "Skip confirmation prompt"
+ optGlobalDesc = switch
+ $ long "global" <> short 'g'
+ <> help "Add for all users"
+ optPathsDesc = many
+ $ argument str $ metavar "PATH"
+ <> help "Directories to add"
main :: IO ()
main = execParser parser >>= addPath
diff --git a/apps/FixNtSymbolPath.hs b/apps/FixNtSymbolPath.hs
index a1b1e9e..a7c3b08 100644
--- a/apps/FixNtSymbolPath.hs
+++ b/apps/FixNtSymbolPath.hs
@@ -28,12 +28,12 @@ optionParser = Options
<$> optYesDesc
<*> optGlobalDesc
where
- optYesDesc = switch $
- long "yes" <> short 'y' <>
- help "Skip confirmation prompt"
- optGlobalDesc = switch $
- long "global" <> short 'g' <>
- help "Set up for all users"
+ optYesDesc = switch
+ $ long "yes" <> short 'y'
+ <> help "Skip confirmation prompt"
+ optGlobalDesc = switch
+ $ long "global" <> short 'g'
+ <> help "Set up for all users"
data Dirs = Dirs
{ pdbsDir :: String
diff --git a/apps/ListPath.hs b/apps/ListPath.hs
index b9cc121..6432455 100644
--- a/apps/ListPath.hs
+++ b/apps/ListPath.hs
@@ -28,15 +28,18 @@ data Options = Options
} deriving (Eq, Show)
optionParser :: Parser Options
-optionParser = Options <$> optNameDesc <*> optWhichPathsDesc
+optionParser = Options
+ <$> optNameDesc
+ <*> optWhichPathsDesc
where
- optNameDesc = strOption $
- long "name" <> short 'n' <> metavar "NAME" <> value "PATH" <>
- help "Variable name ('PATH' by default)"
+ optNameDesc = strOption
+ $ long "name" <> short 'n'
+ <> metavar "NAME" <> value "PATH"
+ <> help "Variable name ('PATH' by default)"
optWhichPathsDesc = pure All
<|> flag' ExistingOnly (long "existing" <> short 'e'
<> help "List existing paths only")
- <|> flag' MissingOnly (long "missing" <> short 'm'
+ <|> flag' MissingOnly (long "missing" <> short 'm'
<> help "List missing paths only")
main :: IO ()
diff --git a/apps/RemovePath.hs b/apps/RemovePath.hs
index 8d9692b..5f5cd1d 100644
--- a/apps/RemovePath.hs
+++ b/apps/RemovePath.hs
@@ -30,18 +30,19 @@ optionParser = Options
<*> optGlobalDesc
<*> optPathsDesc
where
- optNameDesc = strOption $
- long "name" <> short 'n' <> metavar "NAME" <> value "PATH" <>
- help "Variable name ('PATH' by default)"
- optYesDesc = switch $
- long "yes" <> short 'y' <>
- help "Skip confirmation prompt"
- optGlobalDesc = switch $
- long "global" <> short 'g' <>
- help "Remove for all users"
- optPathsDesc = many $ argument str $
- metavar "PATH" <>
- help "Directories to remove"
+ optNameDesc = strOption
+ $ long "name" <> short 'n'
+ <> metavar "NAME" <> value "PATH"
+ <> help "Variable name ('PATH' by default)"
+ optYesDesc = switch
+ $ long "yes" <> short 'y'
+ <> help "Skip confirmation prompt"
+ optGlobalDesc = switch
+ $ long "global" <> short 'g'
+ <> help "Remove for all users"
+ optPathsDesc = many $ argument str
+ $ metavar "PATH"
+ <> help "Directories to remove"
main :: IO ()
main = execParser parser >>= removePath
diff --git a/apps/SetEnv.hs b/apps/SetEnv.hs
index debc1d0..debc62d 100644
--- a/apps/SetEnv.hs
+++ b/apps/SetEnv.hs
@@ -28,18 +28,18 @@ optionParser = Options
<*> optNameDesc
<*> optValueDesc
where
- optYesDesc = switch $
- long "yes" <> short 'y' <>
- help "Skip confirmation prompt"
- optGlobalDesc = switch $
- long "global" <> short 'g' <>
- help "Set for all users"
- optNameDesc = argument str $
- metavar "NAME" <>
- help "Variable name"
- optValueDesc = argument str $
- metavar "VALUE" <>
- help "Variable value"
+ optYesDesc = switch
+ $ long "yes" <> short 'y'
+ <> help "Skip confirmation prompt"
+ optGlobalDesc = switch
+ $ long "global" <> short 'g'
+ <> help "Set for all users"
+ optNameDesc = argument str
+ $ metavar "NAME"
+ <> help "Variable name"
+ optValueDesc = argument str
+ $ metavar "VALUE"
+ <> help "Variable value"
main :: IO ()
main = execParser parser >>= setEnv
diff --git a/apps/UnsetEnv.hs b/apps/UnsetEnv.hs
index e08c95a..4fd6ccb 100644
--- a/apps/UnsetEnv.hs
+++ b/apps/UnsetEnv.hs
@@ -26,15 +26,15 @@ optionParser = Options
<*> optGlobalDesc
<*> optNameDesc
where
- optYesDesc = switch $
- long "yes" <> short 'y' <>
- help "Skip confirmation prompt"
- optGlobalDesc = switch $
- long "global" <> short 'g' <>
- help "Unset for all users"
- optNameDesc = argument str $
- metavar "NAME" <>
- help "Variable name"
+ optYesDesc = switch
+ $ long "yes" <> short 'y'
+ <> help "Skip confirmation prompt"
+ optGlobalDesc = switch
+ $ long "global" <> short 'g'
+ <> help "Unset for all users"
+ optNameDesc = argument str
+ $ metavar "NAME"
+ <> help "Variable name"
main :: IO ()
main = execParser parser >>= unsetEnv