· 4 years ago · Feb 09, 2021, 04:40 AM
1#!/usr/bin/python3
2#
3# Twirl package manager
4#
5# Copyright 2021 VideoToaster <@gmail.com>
6# Copyright 2021 Thewarsawpakt <@gmail.com>
7
8import argparse
9
10parser = argparse.ArgumentParser(
11 "Twirl Package Manager",
12 description = "Invoke the twirl package manager."
13)
14parser.add_argument(
15 "-i",
16 help = "Installs a package with the specified name.",
17 type = str,
18)
19
20parser.add_argument(
21 "-u",
22 help = "Performs a partial upgrade with specified package. WARNING: THIS MAY CAUSE SYSTEM DAMAGE.",
23 type = str
24)
25
26parser.add_argument(
27 "-U",
28 help = "Performs a full system upgrade.",
29 type = str
30)
31
32parser.add_argument(
33 "-l",
34 help = "Updates package listings.",
35 type = str
36)
37
38parser.add_argument(
39 "-r",
40 help = "Removes a package but not it's dependencies.",
41 type = str
42)
43parser.add_argument(
44 "-R",
45 help = "Removes a package and it's dependencies which aren't required by another program.",
46 type = str
47)
48
49parser.add_argument(
50 "-d",
51 help = "Removes dependencies even if they are required by another program. WARNING: THIS MAY CAUSE SYSTEM DAMAGE.",
52 type = str
53)
54
55args = parser.parse_args()
56
57if (args.i and (args.u or args.r or args.R or args.d or args.l)) or (args.u and (args.R or args.d or args.r or args.i or args.l)) or (args.r and (args.l or args.i or args.u)):
58 print("Please read the usage.")
59 exit()