rust/rhg/src/commands/debugrequirements.rs
author Pierre-Yves David <pierre-yves.david@octobus.net>
Fri, 08 Nov 2024 17:08:11 +0100
branchstable
changeset 52216 fa58f4f97337
parent 49640 37bc3edef76f
permissions -rw-r--r--
ci: shard the test run on mac os X This should comes with some benefit: - spread the load across more runner, - reduce the real-time CI run, - reduce the "retry" run when we need them. We start with the Mac jobs, but that would be tremendously useful for Windows too. For linux, we need to reduce the startup overhead for this to be worth it. Building smaller image and speeding up clone should help with that.

use crate::error::CommandError;

pub const HELP_TEXT: &str = "
Print the current repo requirements.
";

pub fn args() -> clap::Command {
    clap::command!("debugrequirements").about(HELP_TEXT)
}

pub fn run(invocation: &crate::CliInvocation) -> Result<(), CommandError> {
    let repo = invocation.repo?;
    let mut output = String::new();
    let mut requirements: Vec<_> = repo.requirements().iter().collect();
    requirements.sort();
    for req in requirements {
        output.push_str(req);
        output.push('\n');
    }
    invocation.ui.write_stdout(output.as_bytes())?;
    Ok(())
}