Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion completions/fastfetch.fish
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,17 @@ end
echo '
import json, subprocess, sys


def main():
data: dict[str, list[dict]] = json.loads(subprocess.check_output(["fastfetch", "--help-raw"]))

for key in data:
for flag in data[key]:
if flag["long"] == "logo-color-[1-9]":
Copy link

Copilot AI May 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider adding an inline comment explaining that the loop generates distinct completions for logo-color flags (1-9) to improve clarity for future maintainers.

Copilot uses AI. Check for mistakes.
for i in range(1, 10):
print(f"""complete -c fastfetch -d "{flag["desc"]}" -l "logo-color-{i}" -x -a "(__fastfetch_complete_color)" """)
continue

if flag.get("pseudo", False):
continue

Expand All @@ -75,7 +81,7 @@ def main():
command_prefix += f""" -o {flag["short"]}"""

if "arg" in flag:
type: str = flag["arg"]["type"];
type: str = flag["arg"]["type"]
if type == "bool":
print(f"{command_prefix} -x -a \"(__fastfetch_complete_bool)\"")
elif type == "color":
Expand All @@ -98,6 +104,7 @@ def main():
else:
print(f"{command_prefix} -f")


if __name__ == "__main__":
try:
main()
Expand Down
Loading