File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -60,13 +60,21 @@ function __fastfetch_complete_structure
6060end
6161
6262echo '
63- import json, subprocess, sys
63+ import json
64+ import subprocess
65+ import sys
66+
6467
6568def main():
6669 data: dict[str, list[dict]] = json.loads(subprocess.check_output(["fastfetch", "--help-raw"]))
6770
6871 for key in data:
6972 for flag in data[key]:
73+ if flag["long"] == "logo-color-[1-9]":
74+ for i in range(1, 10):
75+ print(f"""complete -c fastfetch -d "{flag["desc"]}" -l "logo-color-{i}" -x -a "(__fastfetch_complete_color)" """)
76+ continue
77+
7078 if flag.get("pseudo", False):
7179 continue
7280
@@ -75,7 +83,7 @@ def main():
7583 command_prefix += f""" -o {flag["short"]}"""
7684
7785 if "arg" in flag:
78- type: str = flag["arg"]["type"];
86+ type: str = flag["arg"]["type"]
7987 if type == "bool":
8088 print(f"{command_prefix} -x -a \ "(__fastfetch_complete_bool)\ "")
8189 elif type == "color":
@@ -98,9 +106,11 @@ def main():
98106 else:
99107 print(f"{command_prefix} -f")
100108
109+
101110if __name__ == "__main__":
102111 try:
103112 main()
104- except:
113+ except Exception as e:
114+ print(f"Error: {e}", file=sys.stderr)
105115 sys.exit(1)
106116' | python3 | source
You can’t perform that action at this time.
0 commit comments