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" }