aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/Plugin/Help.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Plugin/Help.hs b/src/Plugin/Help.hs
index 470dd33..a141745 100644
--- a/src/Plugin/Help.hs
+++ b/src/Plugin/Help.hs
@@ -19,7 +19,12 @@ help = Plugin
helpAction :: PluginAction
helpAction _ = do
return $ Right $ T.intercalate "\n"
- [command p `T.append` " – " `T.append` description p | p <- plugins]
+ [T.justifyRight longestCommandLen ' ' (command p)
+ `T.append` " – "
+ `T.append` description p
+ | p <- plugins]
+ where
+ longestCommandLen = foldr (max) 0 (map (T.length . command) plugins)
plugins :: [Plugin]
plugins = PL.plugins ++ [help]