Skip to content
Extraits de code Groupes Projets
Vérifiée Valider abc0409f rédigé par Kubat's avatar Kubat
Parcourir les fichiers

Add the commands to the package display impl

parent ff8e52e0
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -37,4 +37,9 @@ impl Cmd {
CmdHandler::MultiEcho(f) => f(args).join("<br>---"),
}
}
#[allow(dead_code)]
pub fn get_name(&self) -> &str {
&self.name
}
}
......@@ -55,8 +55,19 @@ impl fmt::Display for CmdPackage {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"CmdPackage({}, acls({}), admins({}))",
self.name, self.acl, self.admin_register
"CmdPackage({}, acls({}), admins({}), commands({}))",
self.name,
self.acl,
self.admin_register,
match self.commands.len() != 0 {
true => self
.commands
.iter()
.map(|x| x.get_name().to_string())
.reduce(|x1, x2| format!("{}, {}", x1, x2))
.unwrap(),
false => "".to_string(),
}
)
}
}
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter