debugrequirements.rs
22 lines
| 625 B
| application/rls-services+xml
|
RustLexer
Simon Sapin
|
r46536 | use crate::error::CommandError; | ||
Simon Sapin
|
r46535 | |||
pub const HELP_TEXT: &str = " | ||||
Print the current repo requirements. | ||||
"; | ||||
Simon Sapin
|
r47251 | pub fn args() -> clap::App<'static, 'static> { | ||
clap::SubCommand::with_name("debugrequirements").about(HELP_TEXT) | ||||
} | ||||
Simon Sapin
|
r47334 | pub fn run(invocation: &crate::CliInvocation) -> Result<(), CommandError> { | ||
Simon Sapin
|
r47335 | let repo = invocation.repo?; | ||
Simon Sapin
|
r47250 | 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'); | ||||
Simon Sapin
|
r46535 | } | ||
Simon Sapin
|
r47334 | invocation.ui.write_stdout(output.as_bytes())?; | ||
Simon Sapin
|
r47250 | Ok(()) | ||
Simon Sapin
|
r46535 | } | ||