-
-
Couldn't load subscription status.
- Fork 602
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,13 +60,21 @@ function __fastfetch_complete_structure | |
| end | ||
|
|
||
| echo ' | ||
| import json, subprocess, sys | ||
| import json | ||
| import subprocess | ||
| import 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]": | ||
|
||
| 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 | ||
|
|
||
|
|
@@ -75,7 +83,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": | ||
|
|
@@ -98,9 +106,11 @@ def main(): | |
| else: | ||
| print(f"{command_prefix} -f") | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| try: | ||
| main() | ||
| except: | ||
| except Exception as e: | ||
| print(f"Error: {e}", file=sys.stderr) | ||
AtifChy marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| sys.exit(1) | ||
| ' | python3 | source | ||
Uh oh!
There was an error while loading. Please reload this page.