Skip to main content

execute

Function execute 

Source
pub fn execute<I, S>(sioe: &RunnelIoe, prog_name: &str, args: I) -> Result<()>
where I: IntoIterator<Item = S>, S: AsRef<OsStr>,
Expand description

execute stats

params:

  • sioe: stream in/out/err
  • program: program name. etc. “stats”
  • args: parameter arguments.

return:

  • ok: ()
  • err: anyhow

§Examples

§Example 1: the all statistics

Output the all statistics of input text.

use runnel::RunnelIoeBuilder;

let r = libaki_stats::execute(&RunnelIoeBuilder::new().build(),
    "stats", ["-a"]);

§Example 2: the line count

Output the only line count.

use runnel::RunnelIoeBuilder;

let r = libaki_stats::execute(&RunnelIoeBuilder::new().build(),
    "stats", ["-l"]);