summaryrefslogtreecommitdiffstats
path: root/gita
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-08-02 04:36:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-08-02 04:36:35 +0000
commit914dc999ae3c95404d65de193b8674a5e74075d9 (patch)
treec9ab69faedeed06244aff4d8d42c67b1723a2a22 /gita
parentReleasing debian version 0.15.1-1. (diff)
downloadgita-914dc999ae3c95404d65de193b8674a5e74075d9.tar.xz
gita-914dc999ae3c95404d65de193b8674a5e74075d9.zip
Merging upstream version 0.15.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gita')
-rw-r--r--gita/__main__.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/gita/__main__.py b/gita/__main__.py
index ee4e7e7..8678d36 100644
--- a/gita/__main__.py
+++ b/gita/__main__.py
@@ -178,8 +178,12 @@ def f_group(args: argparse.Namespace):
groups = utils.get_groups()
cmd = args.group_cmd or 'll'
if cmd == 'll':
- for group, repos in groups.items():
- print(f"{group}: {' '.join(repos)}")
+ if 'to_show' in args and args.to_show:
+ gname = args.to_show
+ print(' '.join(groups[gname]))
+ else:
+ for group, repos in groups.items():
+ print(f"{group}: {' '.join(repos)}")
elif cmd == 'ls':
print(' '.join(groups))
elif cmd == 'rename':
@@ -339,9 +343,10 @@ def f_shell(args):
chosen[r] = repos[r]
repos = chosen
cmds = ' '.join(args.man[i:]) # join the shell command into a single string
+ #cmds = args.man[i:]
for name, prop in repos.items():
# TODO: pull this out as a function
- got = subprocess.run(cmds, cwd=prop['path'], check=True, shell=True,
+ got = subprocess.run(cmds, cwd=prop['path'], shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
print(utils.format_output(got.stdout.decode(), name))
@@ -526,7 +531,11 @@ def main(argv=None):
p_group.set_defaults(func=f_group)
group_cmds = p_group.add_subparsers(dest='group_cmd',
help='additional help with sub-command -h')
- group_cmds.add_parser('ll', description='List all groups with repos.')
+ pg_ll = group_cmds.add_parser('ll', description='List all groups with repos.')
+ pg_ll.add_argument('to_show',
+ nargs='?',
+ choices=utils.get_groups(),
+ help="group to show")
group_cmds.add_parser('ls', description='List all group names.')
pg_add = group_cmds.add_parser('add', description='Add repo(s) to a group.')
pg_add.add_argument('to_group',