Skip to content

fish complete: add --logo-color-[1-9] completion #1754

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 15, 2025
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
Preview

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