From 9ff2ece6abc5d0d4a69c2f086209f107fd4f04be Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Mon, 31 Aug 2015 15:45:06 -0700 Subject: gitc: Improve help visibility This improves the visiblity of gitc-init if we can get the gitc config, and hides it otherwise. Change-Id: I82830b0b07c311e8c74397ba79eb4c361f8b6fb5 --- subcmds/help.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'subcmds/help.py') diff --git a/subcmds/help.py b/subcmds/help.py index 4aa3f863..ae5b8f08 100644 --- a/subcmds/help.py +++ b/subcmds/help.py @@ -19,7 +19,8 @@ import sys from formatter import AbstractFormatter, DumbWriter from color import Coloring -from command import PagedCommand, MirrorSafeCommand +from command import PagedCommand, MirrorSafeCommand, RequiresGitcCommand +import gitc_utils class Help(PagedCommand, MirrorSafeCommand): common = False @@ -54,9 +55,17 @@ Displays detailed usage information about a command. def _PrintCommonCommands(self): print('usage: repo COMMAND [ARGS]') print('The most commonly used repo commands are:') + + def gitc_supported(cmd): + if not isinstance(cmd, RequiresGitcCommand): + return True + if gitc_utils.get_gitc_manifest_dir(): + return True + return False + commandNames = list(sorted([name for name, command in self.commands.items() - if command.common])) + if command.common and gitc_supported(command)])) maxlen = 0 for name in commandNames: -- cgit v1.2.3-54-g00ecf