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
This commit is contained in:
parent
2487cb7b2c
commit
9ff2ece6ab
5 changed files with 39 additions and 5 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue