Disclaimer: This is a veeeery newbie level question. I have only gotten past the "Slice" chapter of the Rust book, but I need to write a simple command line application to do a task for me, so I took it as an opportunity to learn a bit of Rust
What am I trying to do
So, I am trying to write a simple application to publish a file to my blog. This is what it needs to do:
- Take one argument (file path)
rsyncto sync the file into a directory on a remote server
- Call a local script (which makes Zola (static site generator) rebuild my site on the remote server)
I realize I can probably just write a simple shell script for this purpose, but since I do not know how to work with arguments in shell scripts yet, I would appreciate if you can show me a Rusty way to do it, so that I can learn about taking command line arguments and using them to issue other commands to my OS in Rust.
Thank you in advance!
Just to add, I am aware that there is a Rust CLI application book, but it is still a little over my head and I don't think I should use external crates for something as tiny as this. Please correct me if I am wrong!