Parse argument of `pijul log --output-format` strictly

[?]
7qFsmcJTAmyi5DxiNk265yTyKeTGNeoqjQfzksWAeGkH
Nov 8, 2022, 4:20 AM
7P7G4J5ZT4S5BP6VAN226Z7CRZXEEVO5YHJ6IFMW27NHBR5TDJRAC

Dependencies

  • [2] U6TQX5Z2 pager function respects cli option and user config files, PAGER env var
  • [3] SXEYMYF7 Fixing the bad changes in history (unfortunately, by rebooting).
  • [4] RUBBHYZ7 Removing unnecessary async/await
  • [5] OU6JOR3C Add path filtering for log, add json output for log

Change contents

  • replacement in pijul/src/commands/log.rs at line 44
    [3.1718][3.347:418]()
    #[clap(long = "output-format")]
    output_format: Option<String>,
    [3.1718]
    [3.418]
    #[clap(long = "output-format", value_enum)]
    output_format: Option<OutputFormat>,
  • edit in pijul/src/commands/log.rs at line 444
    [3.14039]
    [3.14039]
    }
    /// The output format to use when printing logs.
    #[derive(Default, Copy, Clone, Debug, clap::ValueEnum)]
    enum OutputFormat {
    #[default]
    Plaintext,
    Json,
  • replacement in pijul/src/commands/log.rs at line 464
    [2.2307][2.2307:2379](),[2.2379][3.14372:14431](),[3.14372][3.14372:14431]()
    match log_iter.cmd.output_format.as_ref().map(|s| s.as_str()) {
    Some(s) if s.eq_ignore_ascii_case("json") => {
    [2.2307]
    [2.2380]
    match log_iter.cmd.output_format.unwrap_or_default() {
    OutputFormat::Json => {
  • replacement in pijul/src/commands/log.rs at line 468
    [3.14535][2.2451:2535]()
    _ => log_iter.for_each(|entry| match write!(&mut stdout, "{}", entry) {
    [3.14535]
    [2.2535]
    OutputFormat::Plaintext => log_iter.for_each(|entry| match write!(&mut stdout, "{}", entry) {