Add GUI
This commit is contained in:
17
link_mods.py
17
link_mods.py
@@ -99,7 +99,7 @@ def cmd_link(cfg, group: str) -> None:
|
||||
print()
|
||||
|
||||
|
||||
def cmd_unlink(cfg, group: str) -> None:
|
||||
def cmd_unlink(cfg, group: str, yes: bool = False) -> None:
|
||||
group_dir = cfg.downloads / group
|
||||
if not group_dir.is_dir():
|
||||
print(f"ERROR: group folder not found: {group_dir}")
|
||||
@@ -118,10 +118,13 @@ def cmd_unlink(cfg, group: str) -> None:
|
||||
print(f" Group: {group} ({linked_count} linked mod(s))")
|
||||
print()
|
||||
|
||||
choice = input(" Continue? [y/N]: ").strip().lower()
|
||||
if choice not in ("y", "yes"):
|
||||
print(" Aborted.\n")
|
||||
sys.exit(0)
|
||||
if yes:
|
||||
print(" (--yes flag set — skipping confirmation)")
|
||||
else:
|
||||
choice = input(" Continue? [y/N]: ").strip().lower()
|
||||
if choice not in ("y", "yes"):
|
||||
print(" Aborted.\n")
|
||||
sys.exit(0)
|
||||
|
||||
print()
|
||||
|
||||
@@ -158,6 +161,8 @@ def main() -> None:
|
||||
)
|
||||
parser.add_argument("command", choices=["status", "link", "unlink"])
|
||||
parser.add_argument("--group", "-g", metavar="GROUP")
|
||||
parser.add_argument("--yes", "-y", action="store_true",
|
||||
help="Skip confirmation prompt (for non-interactive use)")
|
||||
args = parser.parse_args()
|
||||
|
||||
if not args.group:
|
||||
@@ -176,7 +181,7 @@ def main() -> None:
|
||||
elif args.command == "link":
|
||||
cmd_link(cfg, args.group)
|
||||
elif args.command == "unlink":
|
||||
cmd_unlink(cfg, args.group)
|
||||
cmd_unlink(cfg, args.group, yes=args.yes)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user