ion-cli
ion-cli copied to clipboard
Extract common value-handling logic for both `head` and `dump`
(Suggestion) We should probably shift head related logic to head.rs. Whatever part of dump we are reusing there we should create a helper method for that in dump.rs and then use it in head.rs.
Example:
// dump.rs
pub fn run() {
...
write_ion_values(...) // a helper method that can also be used in head.rs
...
}
// head.rs
pub fn run() {
...
// perform the values option(--values <n>) extraction here and use expect if the option is not found
write_ion_values(...)
...
}
Originally posted by @desaikd in https://github.com/amazon-ion/ion-cli/pull/46#discussion_r1152418049