fix duplicated commands in git-annex-shell usage display
authorJoey Hess <joeyh@joeyh.name>
Mon, 11 Oct 2021 19:39:55 +0000 (15:39 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 11 Oct 2021 19:42:27 +0000 (15:42 -0400)
CmdLine/GitAnnexShell.hs

index ba4f402c1616516c94c7ae97997e499f9fde0a11..aa952d18ad6ad0ec09f598297d49a38e35410d55 100644 (file)
@@ -1,6 +1,6 @@
 {- git-annex-shell main program
  -
- - Copyright 2010-2018 Joey Hess <id@joeyh.name>
+ - Copyright 2010-2021 Joey Hess <id@joeyh.name>
  -
  - Licensed under the GNU AGPL version 3 or higher.
  -}
@@ -49,7 +49,7 @@ cmdsMap = M.fromList $ map mk
        appendcmds = readonlycmds ++ map addGlobalOptions
                [ gitAnnexShellCheck Command.RecvKey.cmd
                ]
-       allcmds = map addGlobalOptions
+       allcmds = appendcmds ++ map addGlobalOptions
                [ gitAnnexShellCheck Command.DropKey.cmd
                , Command.GCryptSetup.cmd
                ]
@@ -61,7 +61,7 @@ cmdsFor :: ServerMode -> [Command]
 cmdsFor = fromMaybe [] . flip M.lookup cmdsMap
 
 cmdsList :: [Command]
-cmdsList = concat $ M.elems cmdsMap
+cmdsList = nub $ concat $ M.elems cmdsMap
 
 addGlobalOptions :: Command -> Command
 addGlobalOptions c = c { cmdglobaloptions = globalOptions ++ cmdglobaloptions c }