Mark stable commit / test-unit (push) Has been cancelled
Mark stable commit / test-integration (push) Has been cancelled
Mark stable commit / test-env-virtual (push) Has been cancelled
Mark stable commit / test-env-nix (push) Has been cancelled
Mark stable commit / test-e2e (push) Has been cancelled
Mark stable commit / test-virgin-user (push) Has been cancelled
Mark stable commit / test-virgin-root (push) Has been cancelled
Mark stable commit / lint-shell (push) Has been cancelled
Mark stable commit / lint-python (push) Has been cancelled
Mark stable commit / mark-stable (push) Has been cancelled
54 lines
1.4 KiB
Python
54 lines
1.4 KiB
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from __future__ import annotations
|
|
|
|
import argparse
|
|
|
|
from .common import add_identifier_arguments
|
|
|
|
|
|
def add_navigation_subparsers(
|
|
subparsers: argparse._SubParsersAction,
|
|
) -> None:
|
|
"""
|
|
Register path / explore / terminal / code / shell commands.
|
|
"""
|
|
path_parser = subparsers.add_parser(
|
|
"path",
|
|
help="Print the path(s) of repository/repositories",
|
|
)
|
|
add_identifier_arguments(path_parser)
|
|
|
|
explore_parser = subparsers.add_parser(
|
|
"explore",
|
|
help="Open repository in Nautilus file manager",
|
|
)
|
|
add_identifier_arguments(explore_parser)
|
|
|
|
terminal_parser = subparsers.add_parser(
|
|
"terminal",
|
|
help="Open repository in a new GNOME Terminal tab",
|
|
)
|
|
add_identifier_arguments(terminal_parser)
|
|
|
|
code_parser = subparsers.add_parser(
|
|
"code",
|
|
help="Open repository workspace with VS Code",
|
|
)
|
|
add_identifier_arguments(code_parser)
|
|
|
|
shell_parser = subparsers.add_parser(
|
|
"shell",
|
|
help="Execute a shell command in each repository",
|
|
)
|
|
add_identifier_arguments(shell_parser)
|
|
shell_parser.add_argument(
|
|
"-c",
|
|
"--command",
|
|
nargs=argparse.REMAINDER,
|
|
dest="shell_command",
|
|
help=("The shell command (and its arguments) to execute in each repository"),
|
|
default=[],
|
|
)
|