Skip to content
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions dsc/src/subcommand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ pub fn resource(subcommand: &ResourceSubCommand, stdin: &Option<String>) {
ResourceSubCommand::List { resource_name, description, tags, format } => {

let mut write_table = false;
let mut methods: Vec<String> = Vec::new();
let mut methods = String::new();
let mut table = Table::new(&["Type", "Kind", "Version", "Methods", "Requires", "Description"]);
if format.is_none() && atty::is(Stream::Stdout) {
// write as table if format is not specified and interactive
Expand Down Expand Up @@ -436,18 +436,18 @@ pub fn resource(subcommand: &ResourceSubCommand, stdin: &Option<String>) {
if !found { continue; }
}

methods = vec!["get".to_string()];
if manifest.set.is_some() { methods.push("set".to_string()); }
if manifest.test.is_some() { methods.push("test".to_string()); }
if manifest.export.is_some() { methods.push("export".to_string()); }
methods = "g---".to_string();
if manifest.set.is_some() { methods.replace_range(1..2, "s"); }
if manifest.test.is_some() { methods.replace_range(2..3, "t"); }
if manifest.export.is_some() { methods.replace_range(3..4, "e"); }
}

if write_table {
table.add_row(vec![
resource.type_name,
format!("{:?}", resource.kind),
resource.version,
methods.join(", "),
methods.clone(),
resource.requires.unwrap_or_default(),
resource.description.unwrap_or_default()
]);
Expand Down