From c69f0d1c1173b2112aece7eace6e2469e4c7461f Mon Sep 17 00:00:00 2001 From: Marty Sluijtman Date: Tue, 21 Jan 2025 12:17:56 +0100 Subject: [PATCH] Documentation --- src/bin/dosh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/bin/dosh b/src/bin/dosh index d48327b..334e1a2 100755 --- a/src/bin/dosh +++ b/src/bin/dosh @@ -4,10 +4,15 @@ let base_url = 'https://cdn.jsdelivr.net/npm/@fawazahmed0/currency-api@latest/v1' -def main [target:string = "usd", source:string = "eur"] { +# Convert one unit of a currency to another using the following API: +# https://github.com/fawazahmed0/exchange-api +def main [target:string = "usd" # Unit of curency to convert to + source:string = "eur" # Base currency to convert from + ] { $"((http get $"($base_url)/currencies/($source).json") | get $source | get $target)\n" } +# Lists all available currencies def "main list" [ ] { http get $"($base_url)/currencies.json" }