Build a [`CommandBuilder`] that re-execs the current binary into this internal subcommand. Each variant owns its own arg layout.
(&self)
| 116 | /// Build a [`CommandBuilder`] that re-execs the current binary into this |
| 117 | /// internal subcommand. Each variant owns its own arg layout. |
| 118 | pub fn get_command_builder(&self) -> Result<CommandBuilder> { |
| 119 | let current_exe = std::env::current_exe() |
| 120 | .context("failed to resolve current executable for internal subcommand")?; |
| 121 | let mut builder = CommandBuilder::new(current_exe); |
| 122 | match self { |
| 123 | InternalCommands::Samply(args) => { |
| 124 | builder.arg("samply"); |
| 125 | builder.args(args.args.iter().cloned()); |
| 126 | } |
| 127 | } |
| 128 | Ok(builder) |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | pub async fn run() -> Result<()> { |
no test coverage detected