Skip to content

Commit c054570

Browse files
authored
fish complete: add --logo-color-[1-9] completion (#1754)
* fish complete: add `--logo-color-[1-9]` completion * reverted unnecessary changes
1 parent ed69a70 commit c054570

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

completions/fastfetch.fish

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,17 @@ end
6262
echo '
6363
import json, subprocess, sys
6464
65+
6566
def main():
6667
data: dict[str, list[dict]] = json.loads(subprocess.check_output(["fastfetch", "--help-raw"]))
6768
6869
for key in data:
6970
for flag in data[key]:
71+
if flag["long"] == "logo-color-[1-9]":
72+
for i in range(1, 10):
73+
print(f"""complete -c fastfetch -d "{flag["desc"]}" -l "logo-color-{i}" -x -a "(__fastfetch_complete_color)" """)
74+
continue
75+
7076
if flag.get("pseudo", False):
7177
continue
7278
@@ -75,7 +81,7 @@ def main():
7581
command_prefix += f""" -o {flag["short"]}"""
7682
7783
if "arg" in flag:
78-
type: str = flag["arg"]["type"];
84+
type: str = flag["arg"]["type"]
7985
if type == "bool":
8086
print(f"{command_prefix} -x -a \"(__fastfetch_complete_bool)\"")
8187
elif type == "color":
@@ -98,6 +104,7 @@ def main():
98104
else:
99105
print(f"{command_prefix} -f")
100106
107+
101108
if __name__ == "__main__":
102109
try:
103110
main()

0 commit comments

Comments
 (0)