Skip to content

Commit 7b0ecf7

Browse files
jaklanmattisssa
authored andcommitted
Add cheat.sh command
1 parent 9c0975f commit 7b0ecf7

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

commands/developer-utils/cheat.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
3+
# Required parameters:
4+
# @raycast.schemaVersion 1
5+
# @raycast.title Query cheat.sh
6+
# @raycast.mode fullOutput
7+
# @raycast.packageName Developer Utilities
8+
9+
# Optional parameters:
10+
# @raycast.icon images/cheat.png
11+
# @raycast.argument1 { "type": "text", "placeholder": "Language / Command" }
12+
# @raycast.argument2 { "type": "text", "placeholder": "Question", "optional": true }
13+
14+
# Documentation:
15+
# @raycast.author Jakub Lanski
16+
# @raycast.authorURL https://github.com/jaklan
17+
# @raycast.description Query the cheat.sh service (https://github.com/chubin/cheat.sh).
18+
19+
language=$1
20+
question=${2// /+}
21+
22+
if [ -z "$question" ]; then
23+
curl -s cht.sh/$language
24+
else
25+
curl -s cht.sh/$language/$question
26+
fi
1.21 KB
Loading

0 commit comments

Comments
 (0)