1 2 3 4 5 6 7 8 9 10 11 12 13
use clap::Parser; /// Reverse a string #[derive(Parser)] pub struct Cli { /// The string to reverse pub string: String, } pub fn run(cli: Cli) { let reversed: String = cli.string.chars().rev().collect(); println!("Reversed string: {}", reversed); }