Support runtime clap shell complete and mangen
During the packaging process of software sources, we usually generate shell complete and manpage files by running the binary build file after the binary file is built, like this: https://github.com/NixOS/nixpkgs/blob/7f66c2e0a779397c06603eea55d7b85ee26fe50a/pkgs/applications/audio/radioboat/default.nix#L37-L42
postInstall = ''
installShellCompletion --cmd radioboat \
--bash <($out/bin/radioboat completion bash) \
--fish <($out/bin/radioboat completion fish) \
--zsh <($out/bin/radioboat completion zsh)
'';
Because the build output path of Rust is not fixed, it is difficult for us to find the required files from the build results. So if you can support generating these files at runtime, it will be easier for us to package your software. You can do this like this: https://github.com/MaaAssistantArknights/maa-cli/blob/d7b20842347b9835a540e6ce66d7bd5e8d8e4424/maa-cli/src/main.rs#L132-L142
Command::Complete { shell } => {
clap_complete::generate(shell, &mut CLI::command(), "maa", &mut std::io::stdout());
}
Command::Mangen { path } => {
clap_mangen::generate_to(CLI::command(), path)?;
}