summaryrefslogtreecommitdiffstats
path: root/subcmds/list.py
diff options
context:
space:
mode:
Diffstat (limited to 'subcmds/list.py')
-rw-r--r--subcmds/list.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/subcmds/list.py b/subcmds/list.py
index 7825dee1..0dfaf317 100644
--- a/subcmds/list.py
+++ b/subcmds/list.py
@@ -25,6 +25,11 @@ class List(Command, MirrorSafeCommand):
25 helpDescription = """ 25 helpDescription = """
26List all projects; pass '.' to list the project for the cwd. 26List all projects; pass '.' to list the project for the cwd.
27 27
28By default, only projects that currently exist in the checkout are shown. If
29you to list all projects (using the specified filter settings), use the --all
30option. If you want to show all projects regardless of the manifest groups,
31then also pass --groups all.
32
28This is similar to running: repo forall -c 'echo "$REPO_PATH : $REPO_PROJECT"'. 33This is similar to running: repo forall -c 'echo "$REPO_PATH : $REPO_PROJECT"'.
29""" 34"""
30 35
@@ -35,6 +40,9 @@ This is similar to running: repo forall -c 'echo "$REPO_PATH : $REPO_PROJECT"'.
35 p.add_option('-g', '--groups', 40 p.add_option('-g', '--groups',
36 dest='groups', 41 dest='groups',
37 help="Filter the project list based on the groups the project is in") 42 help="Filter the project list based on the groups the project is in")
43 p.add_option('-a', '--all',
44 action='store_true',
45 help='Show projects regardless of checkout state')
38 p.add_option('-f', '--fullpath', 46 p.add_option('-f', '--fullpath',
39 dest='fullpath', action='store_true', 47 dest='fullpath', action='store_true',
40 help="Display the full work tree path instead of the relative path") 48 help="Display the full work tree path instead of the relative path")
@@ -61,7 +69,7 @@ This is similar to running: repo forall -c 'echo "$REPO_PATH : $REPO_PROJECT"'.
61 args: Positional args. Can be a list of projects to list, or empty. 69 args: Positional args. Can be a list of projects to list, or empty.
62 """ 70 """
63 if not opt.regex: 71 if not opt.regex:
64 projects = self.GetProjects(args, groups=opt.groups) 72 projects = self.GetProjects(args, groups=opt.groups, missing_ok=opt.all)
65 else: 73 else:
66 projects = self.FindProjects(args) 74 projects = self.FindProjects(args)
67 75
@@ -79,5 +87,6 @@ This is similar to running: repo forall -c 'echo "$REPO_PATH : $REPO_PROJECT"'.
79 else: 87 else:
80 lines.append("%s : %s" % (_getpath(project), project.name)) 88 lines.append("%s : %s" % (_getpath(project), project.name))
81 89
82 lines.sort() 90 if lines:
83 print('\n'.join(lines)) 91 lines.sort()
92 print('\n'.join(lines))