* `!col_threshold <N>` to set the threshold at which entries get columns rather than being left as notes on the right. Default: 2
* `!hide <column>` to omit a column
* `!label <column>:<new label>` to change a column's label without needing to change all the input occurrences.
+* `!mark <column>:<mark>` to change the character that is used as the tally-mark for that column
(For the other `tablify` that makes ascii-art tables, see [Text-RecordParser][].)
.substitute_labels
.insert(col.to_owned(), label.to_owned()),
};
+ } else if let Some(directive) = cmd.strip_prefix("mark ") {
+ match directive.split_once(':') {
+ None => {
+ return Err(std::io::Error::new(
+ std::io::ErrorKind::InvalidInput,
+ format!("line {line_num}: Mark missing ':'"),
+ ))
+ }
+ Some((col, label)) => self.mark.insert(col.to_owned(), label.to_owned()),
+ };
} else {
return Err(std::io::Error::new(
std::io::ErrorKind::InvalidInput,
.substitute_labels["foo"],
"bar"
);
+ assert_eq!(read_config(&b"!mark foo:*"[..]).unwrap().mark["foo"], "*");
let bad_command = read_config(&b"!no such command"[..]);
assert!(bad_command.is_err());
let bad_sub = read_config(&b"!label foo"[..]);
assert!(bad_sub.is_err());
assert!(format!("{bad_sub:?}").contains("line 1: Annotation missing ':'"));
+
+ let bad_mark = read_config(&b"!mark foo"[..]);
+ assert!(bad_mark.is_err());
+ assert!(format!("{bad_mark:?}").contains("line 1: Mark missing ':'"));
}
#[test]