Skip to content
  • Brandon Casey's avatar
    parse-options: only insert newline in help text if needed · a6304fa4
    Brandon Casey authored and Junio C Hamano's avatar Junio C Hamano committed
    
    
    Currently, when parse_options() produces a help message it always emits
    a blank line after the usage text to separate it from the options text.
    If the option spec does not define any switches, or only defines hidden
    switches that will not be displayed, then the help text will end up with
    two trailing blank lines instead of one.  Let's defer emitting the blank
    line between the usage text and the options text until it is clear that
    the options section will not be empty.
    
    Fixes t1502.5, t1502.6.
    
    Signed-off-by: default avatarBrandon Casey <drafnel@gmail.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    a6304fa4