fn parse_subcommands(args: &LeftwmArgs) -> ! {
    const SUBCOMMAND_INDEX: usize = 1;
    const SUBCOMMAND_ARGS_INDEX: usize = 2;

    let subcommand = &args[SUBCOMMAND_INDEX];
    let subcommand_args = args[SUBCOMMAND_ARGS_INDEX..].to_vec();

    if is_subcommand(subcommand) {
        execute_subcommand(subcommand, subcommand_args);
    } else if subcommand == "help" {
        if subcommand_args.is_empty() {
            print_help_page();
        } else if is_subcommand(&subcommand_args[0]) {
            execute_subcommand(&subcommand_args[0], vec!["--help".to_string()]);
        } else {
            println!("No such subcommand. Try 'leftwm --help' to find valid subcommands.");
        }
    } else if subcommand == "--version" || subcommand == "-v" {
        println!("leftwm {}", env!("CARGO_PKG_VERSION"));
    } else {
        print_help_page();
    }

    exit(0);
}
Tries to parse the subcommands from the arguments of leftwm and executes them if suitalbe.
Otherwise it's calling the help-page.
leftwm/src/bin/leftwm.rs