Function cpp_linter::run::run_main
source · pub async fn run_main(args: Vec<String>) -> i32Expand description
This is the backend entry point for console applications.
The idea here is that all functionality is implemented in Rust. However, passing command line arguments is done differently in Python or Rust.
- In python, the
sys.argvlist is passed from thecpp_linter.entry_point.main()function to rust via thecpp_linter.run.main()binding (which wrapsrun_main()). - In rust, the
std::env::argsis passed torun_main()in the binary sourcemain.rs.
This is done because of the way the python entry point is invoked. If std::env::args
is used instead of python’s sys.argv, then the list of strings includes the entry point
alias (“path/to/cpp-linter.exe”). Thus, the parser in crate::cli will halt on an error
because it is not configured to handle positional arguments.