candlecorp / wick

Functional, reactive WebAssembly with a twist
https://candle.dev
Other
471 stars 17 forks source link

Added "@file.txt" style inclusion of files for CLI args #452

Closed jsoverson closed 1 year ago

jsoverson commented 1 year ago

This PR adds the ability to include raw files as values to CLI arguments with the curl-like syntax @file-to-include.txt, e.g.:

$ wick invoke candle_ml/yolo:0.0.2 detect --with=@config.json -- --image_data=@soccer.jpg

The data is processed the same way as if it were parsed as a CLI argument value with the one exception being: if the destination type is bytes, then the file is read as bytes and encoded to wick-style base64 bytes.