Skip to content

Commit

Permalink
foreach-repo: add example to description
Browse files Browse the repository at this point in the history
  • Loading branch information
zapster committed Sep 11, 2023
1 parent 5ca8203 commit a8e895b
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions mx_foreach.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,30 @@
# ----------------------------------------------------------------------------------------------------
#
import argparse
import textwrap

import mx


@mx.command('mx', 'foreach-repo')
def foreach_repo(args):
"""Run a command in the root of all repos of imported suites."""

parser = argparse.ArgumentParser(prog='mx foreach-repo',
description='''Run a command in the root of all repos of imported suites.''',
formatter_class=argparse.RawDescriptionHelpFormatter,
description=textwrap.dedent('''
Run a command in the root of all repos of imported suites.
Example:
$ mx foreach-repo pwd
Entering directory
Running: pwd
.../path/to/graalpython
Leaving directory
Entering directory
Running: pwd
.../path/to/graal
Leaving directory
'''.rstrip()),
usage='%(prog)s [options] [--] command...')
parser.add_argument('-n', '--dry-run', action='store_true', help='show what would be removed without actually doing anything')

Expand Down

0 comments on commit a8e895b

Please sign in to comment.