Skip to content
  • Christian Couder's avatar
    help: make 'git-help--browse' usable outside 'git-help'. · 482cce82
    Christian Couder authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    "git-help--browse" helper is to launch a browser of the user's choice
    to view the HTML version of git documentation for a given command.  It
    used to take the name of a command, convert it to the path of the
    documentation by prefixing the directory name and appending the
    ".html" suffix, and start the browser on the path.
    
    This updates the division of labor between the caller in help.c and
    git-help--browser helper.  The helper is now responsible for launching
    a browser of the user's choice on given URLs, and it is the caller's
    responsibility to tell it the paths to documentation files.
    
    This is in preparation to reuse the logic to choose user's preferred
    browser in instaweb.
    
    The helper had a provision for running it without any command name, in
    which case it showed the toplevel "git(7)" documentation, but the
    caller in help.c never makes such a call.  The helper now exits with a
    usage message when no path is given.
    
    Signed-off-by: default avatarChristian Couder <chriscool@tuxfamily.org>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    482cce82