added info to the default modules folder.
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
name: info
|
||||||
|
output_type: String,
|
||||||
|
new_thread: false
|
||||||
|
args: config_file,config,projects
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Show information about the tool including current settings and loaded modules.
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
let lines = [];
|
||||||
|
|
||||||
|
lines.push("==================================================");
|
||||||
|
lines.push(" TETANUS SYSTEM INFORMATION");
|
||||||
|
lines.push("==================================================");
|
||||||
|
|
||||||
|
// 1. Format Config Map (Settings)
|
||||||
|
lines.push("");
|
||||||
|
lines.push("[Settings]");
|
||||||
|
let keys = config.keys();
|
||||||
|
for k in keys {
|
||||||
|
lines.push("- " + k + ": " + config[k]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. Format Project List
|
||||||
|
lines.push("");
|
||||||
|
lines.push("[Active Projects]");
|
||||||
|
lines.push(fill_space("Customer Name", 20) + " | " + fill_space("Project Name", 20) + " | Stage");
|
||||||
|
lines.push("--------------------------------------------------");
|
||||||
|
|
||||||
|
for p in projects {
|
||||||
|
let customer = p.org_name;
|
||||||
|
let name = p.name;
|
||||||
|
let stage = "upcoming";
|
||||||
|
if p.current == true{
|
||||||
|
stage = "current";
|
||||||
|
}
|
||||||
|
lines.push(fill_space(customer, 20) + " | " + fill_space(name, 20) + " | " + stage);
|
||||||
|
}
|
||||||
|
|
||||||
|
lines.push("--------------------------------------------------");
|
||||||
|
|
||||||
|
// Return the array of lines back to Rust
|
||||||
|
lines;
|
||||||
|
|
||||||
|
// Helper function for padding spaces
|
||||||
|
fn fill_space(text, len) {
|
||||||
|
let s = text.to_string();
|
||||||
|
while s.len < len {
|
||||||
|
s += " ";
|
||||||
|
}
|
||||||
|
return s;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user