From 938e938577a3b6c21b3ddc2eb1eac769acf5da3c Mon Sep 17 00:00:00 2001 From: Jeff Date: Fri, 18 Aug 2023 13:57:52 -0400 Subject: [PATCH] Edit article --- www/src/its_time_to_rethink_the_command_line_shell.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/www/src/its_time_to_rethink_the_command_line_shell.md b/www/src/its_time_to_rethink_the_command_line_shell.md index 74d3726..dea1c8f 100644 --- a/www/src/its_time_to_rethink_the_command_line_shell.md +++ b/www/src/its_time_to_rethink_the_command_line_shell.md @@ -84,9 +84,13 @@ json_string = to_json(parsed_data); ## Writing Unix Tools for Structured Data -Rust users are lucky to have [serde], a library that can create in-memory values from data formats and vica versa. If you are compiling a program to be used as a command-line tool, I would urge you to think about how you might use structured data as input and output. [Pandoc], for example, can use a YAML file as an alternative to command-line arguments but I would prefer it to have an additional option to pass that YAML to standard input. In the meantime, it is easy enough to implement pandoc's features in whale by translating a data structure into command line arguments. It is not a perfect solution but it goes a long way to prove that the command line shell is still the gold standard of computing. +Rust users are lucky to have [serde], a library that can create in-memory values from data formats and vica versa. If you are compiling a program to be used as a command-line tool, I would urge you to think about how you might use structured data as input and output. [Pandoc], for example, can use a YAML file as an alternative to command-line arguments but I would prefer it to have an additional option to pass that YAML to standard input. In the meantime, it is easy enough to implement pandoc's features in whale by translating a data structure into command line arguments. It is not a perfect solution but it goes a long way to prove that the commacnd line shell is still the gold standard of computing. + +If you are interested in structured data on the command line, [whale] is in its experimental phase and I'm happy to talk more about it. [Nushell] is a more mature example of a command-line shell with structured data and [jq] is an excellent resource for querying JSON. [Pandoc]: https://pandoc.org/ [serde]: https://serde.rs/ [nushell]: https://www.nushell.sh/ [whale]: https://git.jeffa.io/jeff/whale +[jq]: https://jqlang.github.io/jq/ +[The Unix Tools Philosophy]: https://tldp.org/LDP/GNU-Linux-Tools-Summary/html/c1089.htm