This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function brew_search { | |
echo -e "FullName\tShortName\tHomepage\tDescription" &&\ | |
curl -s -k -X GET https://formulae.brew.sh/api/{formula,cask}.json |\ | |
jq ". + input" |\ | |
jq -r ".[] | select(.desc | . != null and (ascii_downcase | match(\"$1\"))) | [.full_token // .full_name, .token // .name, .homepage, .desc] | @tsv" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import takewhile | |
from typing import Any, Callable, Set | |
import click | |
class VariadicOption(click.Option): | |
"""Variadic option for python-click CLI. | |
""" | |
_processor: Callable[..., Any] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function toopts { | |
jq -r 'to_entries | map("--\(.key)\n\(.value | if type=="array" then map(@text) | join("\n") else . end)")[]' "$1"; | |
} |