15 lines
391 B
Bash
Executable File
15 lines
391 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
# @describe Use this function to search DuckDuckGo for a query.
|
|
# @meta require-tools ddgr
|
|
# @option --query! The query to search for.
|
|
# @option --max-results=5 The number of returned results.
|
|
|
|
main() {
|
|
ddgr --num $argc_max_results --json "$argc_query" | \
|
|
jq -r '.[] | "**[\(.title)](\(.url))**\n\(.abstract)\n"'
|
|
}
|
|
|
|
eval "$(argc --argc-eval "$0" "$@")"
|