manager update
This commit is contained in:
parent
8fd5567ed2
commit
e10f10183f
1 changed files with 14 additions and 3 deletions
|
@ -30,9 +30,9 @@ def main():
|
|||
|
||||
ap.add_argument("--savefile", help="The savefile to use",
|
||||
default=os.path.expanduser("~/.local/faulty/neo.save"))
|
||||
ap.add_argument("--del-savefile", help="Delete the savefile",
|
||||
ap.add_argument("--del-savefile", "--rm-save", help="Delete the savefile",
|
||||
action="store_true")
|
||||
ap.add_argument("--ignore-savefile", help="Ignore the savefile",
|
||||
ap.add_argument("--ignore-savefile", "--no-load", help="Ignore the savefile",
|
||||
action="store_true")
|
||||
|
||||
# -x, --exclude: e.g. -x this -x that
|
||||
|
@ -75,11 +75,21 @@ def main():
|
|||
|
||||
if args.save:
|
||||
savefile["files"] = files
|
||||
return
|
||||
|
||||
def handle_aliases(fnlist: dict, name: str):
|
||||
return fnlist.get(name, lambda: print("does not exist"))
|
||||
|
||||
def dump_data():
|
||||
print(f"savefile: {args.savefile}")
|
||||
print(f"del_savefile: {args.del_savefile}")
|
||||
print(f"ignore_savefile: {args.ignore_savefile}")
|
||||
print(f"exclude: {args.exclude}")
|
||||
print(f"include: {args.include}")
|
||||
print(f"save: {args.save}")
|
||||
print(f"action: {args.action}")
|
||||
print(f"args: {args.args}")
|
||||
print(f"files: {files}")
|
||||
|
||||
fnlist = {
|
||||
"up": lambda: dc(f"up -d {' '.join(args.args)}"),
|
||||
"upr": lambda: dc(f"up -d --build {' '.join(args.args)}"),
|
||||
|
@ -87,6 +97,7 @@ def main():
|
|||
"default": lambda: dc(f"{' '.join(args.args)}"),
|
||||
"setup": lambda: setup_handler(args.args[0]),
|
||||
"delete-project-files": lambda: os.system(f"sudo rm -rf /srv/{args.args[0]}"),
|
||||
"_dump": lambda: dump_data(),
|
||||
|
||||
"dpf": lambda: handle_aliases(fnlist, "delete-project-files")()
|
||||
}
|
||||
|
|
Reference in a new issue