Man pages for individual commands now available, and can be opened using "git annex help <command>"
This commit is contained in:
parent
bc1c18a951
commit
3cc7c03721
3 changed files with 20 additions and 2 deletions
|
@ -23,7 +23,7 @@ import System.Console.GetOpt
|
|||
|
||||
cmd :: [Command]
|
||||
cmd = [noCommit $ noRepo startNoRepo $ dontCheck repoExists $
|
||||
command "help" paramNothing seek SectionQuery "display help"]
|
||||
command "help" (paramOptional "COMMAND") seek SectionCommon "display help"]
|
||||
|
||||
seek :: CommandSeek
|
||||
seek = withWords start
|
||||
|
@ -38,6 +38,7 @@ startNoRepo = start'
|
|||
|
||||
start' :: [String] -> IO ()
|
||||
start' ["options"] = showCommonOptions
|
||||
start' [c] = showGitHelp c
|
||||
start' _ = showGeneralHelp
|
||||
|
||||
showCommonOptions :: IO ()
|
||||
|
@ -58,8 +59,17 @@ showGeneralHelp = putStrLn $ unlines
|
|||
, Command.Fsck.cmd
|
||||
]
|
||||
, "Run 'git-annex' for a complete command list."
|
||||
, "Run 'git-annex command --help' for help on a specific command."
|
||||
, "Run 'git-annex help command' for help on a specific command."
|
||||
, "Run `git annex help options' for a list of common options."
|
||||
]
|
||||
where
|
||||
cmdline c = "\t" ++ cmdname c ++ "\t" ++ cmddesc c
|
||||
|
||||
showGitHelp :: String -> IO ()
|
||||
showGitHelp c =
|
||||
unlessM (githelp) $
|
||||
putStrLn $ "View online help at " ++ url
|
||||
where
|
||||
githelp = boolSystem "git" [Param "help", Param fullc]
|
||||
fullc = "git-annex-" ++ c
|
||||
url = "https://git-annex.branchable.com/" ++ fullc ++ "/"
|
||||
|
|
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -7,6 +7,8 @@ git-annex (5.20150318) UNRELEASED; urgency=medium
|
|||
is updated. Needed for git update-server-info.
|
||||
* migrate: --force will force migration of keys already using the
|
||||
destination backend. Useful in rare cases.
|
||||
* Man pages for individual commands now available, and can be
|
||||
opened using "git annex help <command>"
|
||||
|
||||
-- Joey Hess <id@joeyh.name> Thu, 19 Mar 2015 17:05:32 -0400
|
||||
|
||||
|
|
|
@ -60,6 +60,12 @@ files in the directory. When no path is specified, most git-annex commands
|
|||
default to acting on all relevant files in the current directory (and
|
||||
subdirectories).
|
||||
|
||||
* `help`
|
||||
|
||||
Display built-in help.
|
||||
|
||||
For help on a specific command, use `git annex help command`
|
||||
|
||||
* `add [path ...]`
|
||||
|
||||
Adds files in the path to the annex. If no path is specified, adds
|
||||
|
|
Loading…
Reference in a new issue