Merge "Add new dump format map in aconfig" into main
This commit is contained in:
@@ -268,6 +268,7 @@ pub enum DumpFormat {
|
|||||||
Verbose,
|
Verbose,
|
||||||
Protobuf,
|
Protobuf,
|
||||||
Textproto,
|
Textproto,
|
||||||
|
Bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn dump_parsed_flags(
|
pub fn dump_parsed_flags(
|
||||||
@@ -318,6 +319,17 @@ pub fn dump_parsed_flags(
|
|||||||
let s = protobuf::text_format::print_to_string_pretty(&parsed_flags);
|
let s = protobuf::text_format::print_to_string_pretty(&parsed_flags);
|
||||||
output.extend_from_slice(s.as_bytes());
|
output.extend_from_slice(s.as_bytes());
|
||||||
}
|
}
|
||||||
|
DumpFormat::Bool => {
|
||||||
|
for parsed_flag in parsed_flags.parsed_flag.into_iter() {
|
||||||
|
let line = format!(
|
||||||
|
"{}.{}={:?}\n",
|
||||||
|
parsed_flag.package(),
|
||||||
|
parsed_flag.name(),
|
||||||
|
parsed_flag.state() == ProtoFlagState::ENABLED
|
||||||
|
);
|
||||||
|
output.extend_from_slice(line.as_bytes());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Ok(output)
|
Ok(output)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user