# HG changeset patch # User Nikolaj Sjujskij # Date 1345101706 -14400 # Node ID aaaeea31482afcd25a741bf50f1fdbbd56f41c7d # Parent e82fad58df1eda90752f0c3af85af24142a6a9ca zsh completion: complete additional topics for `help`, not commands only diff -r e82fad58df1e -r aaaeea31482a contrib/zsh_completion --- a/contrib/zsh_completion Mon Aug 27 21:10:11 2012 +0200 +++ b/contrib/zsh_completion Thu Aug 16 11:21:46 2012 +0400 @@ -361,6 +361,19 @@ 'urls:URL:_hg_urls' } +_hg_add_help_topics=( + config dates diffs environment extensions filesets glossary hgignore hgweb + merge-tools multirevs obsolescence patterns phases revisions revsets + subrepos templating urls +) + +_hg_help_topics() { + local topics + (( $#_hg_cmd_list )) || _hg_get_commands + topics=($_hg_cmd_list $_hg_add_help_topics) + _describe -t help_topics 'help topics' topics +} + # Common options _hg_global_opts=( '(--repository -R)'{-R+,--repository}'[repository root directory]:repository:_files -/' @@ -588,7 +601,7 @@ _hg_cmd_help() { _arguments -s -w : $_hg_global_opts \ - '*:mercurial command:_hg_commands' + '*:mercurial help topic:_hg_help_topics' } _hg_cmd_identify() {