Here's How You Can Build Your Own Markdown Parser: Part 2 - How to Read File From the Command Line | HackerNoon
Briefly

A command-line interface is implemented to accept a markdown file as an argument, read its content, and print the content in the terminal. Required modules include std::env for handling command-line arguments and std::fs for file operations. The command-line arguments are collected into a Vec<String>, which allows checking whether a markdown file was provided. If no file is specified, the program prompts the user to enter a markdown file to avoid errors.
This program implements a command-line interface that accepts a markdown file as a command-line argument, reads its content, and prints the entire content to the terminal.
The required modules include std::env for command-line argument access and std::fs for file operations like reading and writing.
The args variable collects all command-line arguments and stores them in a Vec<String>, which is used to check if a markdown file was provided.
If the user does not provide a markdown file, the program prompts them to do so by printing a message to the terminal.
Read at Hackernoon
[
|
]