"library-list @table@ wikimedia chess-yellow-?"
)?;
let output: String = self.otter(&command)?.into();
- assert!( Regex::new("(?m)^chess-yellow-K *the yellow king$")?
+ assert!( Regex::new("(?m)^wikimedia *chess-yellow-K *the yellow king$")?
.find(&output)
.is_some(),
"got: {}", &output);
Preview,
}
-pub type ItemForOutput = (String, ItemEnquiryData);
+pub type ItemForOutput = ItemEnquiryData;
pub const VIS: ShowUnocculted = ShowUnocculted::new_visible();
}
let mut pieces: Vec<Prep> = items.into_iter().map(|it| {
- let spec = ItemSpec { lib: it.0, item: it.1.itemname.into() };
- let sortkey = it.1.sortkey;
+ let spec = ItemSpec { lib: it.libname.into(), item: it.itemname.into() };
+ let sortkey = it.sortkey;
(||{
let (p, _occultable) = spec.clone()
.find_load(&ig_dummy, SpecDepth::zero())
for contents in all_registries.lib_name_lookup(&lib)? {
for pat in opts.items.split(SPLIT) {
for item in contents.list_glob(pat)? {
- items.push((lib.clone(), item))
+ items.push(item)
}
}
}
items.sort();
match opts.outkind {
- OutputKind::List => for item in &items {
- println!("{:<10} {}", &item.0, &item.1);
+ OutputKind::List => for item in items {
+ println!("{}", item);
}
OutputKind::Preview => {
preview(items)?
#[derive(Debug,Clone,Serialize,Deserialize,Eq,PartialEq,Ord,PartialOrd)]
pub struct ItemEnquiryData {
+ pub libname: String,
pub itemname: GoodItemName,
pub sortkey: Option<String>,
pub f0desc: Html,
impl Display for ItemEnquiryData {
#[throws(fmt::Error)]
fn fmt(&self, f: &mut Formatter) {
- write!(f, "{:20} {}", self.itemname, self.f0desc.as_html_str())?;
+ write!(f, "{:<10} {:20} {}", &self.libname, &self.itemname,
+ self.f0desc.as_html_str())?;
}
}
};
let f0bbox = loaded.bbox_approx()?;
let ier = ItemEnquiryData {
+ libname: self.libname.clone(),
itemname: (**k).to_owned(),
sortkey: v.sort.to_owned(),
f0bbox,