Skip to content

Commit a797944

Browse files
authored
-- UNIX style command parsing support added (#108)
Unix style `--` separator support added to avoid `-c=""` dependency
1 parent eb9ec42 commit a797944

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ mud --diverged git pull
6161
| `mud complete-branch-all` | prints unique local and remote branch names across repositories for shell completion. |
6262
| `mud tags`/`mud t` | displays git tags in repositories. |
6363

64+
`--` format is also supported. An example would be `mud -- git status`.
65+
6466
### Flags
6567

6668
`mud <FLAG> <COMMAND>` will execute a bash command across all repositories.

src/mud/app.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,11 @@ def _filter_with_arguments(self) -> None:
233233
index = 1
234234
while index < len(sys.argv):
235235
arg = sys.argv[index]
236+
# Support '-- command' style: treat everything after '--' as the command
237+
if arg == '--':
238+
self.command = ' '.join(sys.argv[index+1:])
239+
del sys.argv[index:]
240+
break
236241
if not arg.startswith('-'):
237242
break
238243
if any(arg.startswith(prefix) for prefix in LABEL_PREFIX):

0 commit comments

Comments
 (0)