ronantakizawa/codereview-bench huggingface dataset:
Repository: reduxjs/redux
File: test/typescript/store.ts (TypeScript)

Code before:
import {
  Store,
  createStore,
  Reducer,
  Action,
  StoreEnhancer,
  StoreCreator,
  StoreEnhancerStoreCreator,
  Unsubscribe,
  Observer,
  PreloadedState,
  CombinedState
} from 'redux'
// @ts-ignore
import $$observable from '../src/utils/symbol-observable'

type BrandedString = string & { _brand: 'type' }
const brandedString = 'a string' as BrandedString

type State = {
  a: 'a'
  b: {
    c: 'c'
    d: 'd'
  }
  c: BrandedString
}

interface DerivedAction extends Action {
  type: 'a'
  b: 'b'
}

const reducer: Reducer<State> = (
  state: State | undefined = {
    a: 'a',
    b: {

Review comment (suggestion):
This should make Prettier happy:
```suggestion
  CombinedState,
```

Code after:
import {
  Store,
  createStore,
  Reducer,
  Action,
  StoreEnhancer,
  StoreCreator,
  StoreEnhancerStoreCreator,
  Unsubscribe,
  Observer,
  PreloadedState,
  CombinedState,
} from 'redux'
// @ts-ignore
import $$observable from '../src/utils/symbol-observable'

type BrandedString = string & { _brand: 'type' }
const brandedString = 'a string' as BrandedString

type State = {
  a: 'a'
  b: {
    c: 'c'
    d: 'd'
  }
  c: BrandedString
}

interface DerivedAction extends Action {
  type: 'a'
  b: 'b'
}

const reducer: Reducer<State> = (
  state: State | undefined = {
    a: 'a',
    b: {
Repository: sentsin/layui
File: src/modules/upload.js (JavaScript)

Code before:
      $(this).trigger('upload.action');
    });
    
    // 绑定元素索引
    options.elem.data(MOD_INDEX, options.id);
  };

    /**
   * 上传组件辅助方法
   * @type {{parseSize: ((function((number|float), *=): string)|*)}}
   */
  upload.util = {
    /**
     * 文件大小处理
     * @param {number|float} size -文件大小
     * @param precision
     * @return {string}
     */
    parseSize: function (/*文件大小*/size, precision) {
      precision = precision || 2;
      if (null == size || !size) {
        return '0';
      }
      var unitArr = ["Bytes", "Kb", "Mb", "Gb", "Tb", "Pb", "Eb", "Zb", "Yb"];
      var index;
      var formatSize = typeof value === 'string' ? parseFloat(size + '') : size;
      index = Math.floor(Math.log(formatSize) / Math.log(1024));
      size = formatSize / Math.pow(1024, index);
      size = size % 1 === 0 ? size : parseFloat(size.toFixed(precision));//保留的小数位数
      return size + unitArr[index];
    }
  }

  // 记录所有实例
  thisModule.that = {}; // 记录所有实例对象

  // 获取当前实例对象
  thisModule.getThis = function(id){
    var that = thisModule.that[id];
    if(!that) hint.error(id ? (MOD_NAME +' instance with ID \''+ id +'\' not found') : 'ID argument required');
    return that;
  };
  
  // 核心入口  
  upload.render = function(options){
    var inst = new Class(options);
    return thisModule.call(inst);
  };
  
  exports(MOD_NAME, upload);
});

Review comment (suggestion):
```suggestion
      var formatSize = typeof size === 'string' ? parseFloat(size + '') : size;
```

Code after:
    options.bindAction.on('click', function(){
      $(this).trigger('upload.action');
    });
    
    // 绑定元素索引
    options.elem.data(MOD_INDEX, options.id);
  };

  /**
   * 上传组件辅助方法
   */
  upload.util = {
    /**
     * 文件大小处理
     * @param {number | string} size -文件大小
     * @param {number} [precision] - 数值精度
     * @return {string}
     */
    parseSize: function (size, precision) {
      precision = precision || 2;
      if (null == size || !size) {
        return '0';
      }
      var unitArr = ["Bytes", "Kb", "Mb", "Gb", "Tb", "Pb", "Eb", "Zb", "Yb"];
      var index;
      var formatSize = typeof size === 'string' ? parseFloat(size) : size;
      index = Math.floor(Math.log(formatSize) / Math.log(1024));
      size = formatSize / Math.pow(1024, index);
      size = size % 1 === 0 ? size : parseFloat(size.toFixed(precision));//保留的小数位数
      return size + unitArr[index];
    }
  }

  // 记录所有实例
  thisModule.that = {}; // 记录所有实例对象

  // 获取当前实例对象
  thisModule.getThis = function(id){
    var that = thisModule.that[id];
    if(!that) hint.error(id ? (MOD_NAME +' instance with ID \''+ id +'\' not found') : 'ID argument required');
    return that;
  };
  
  // 核心入口  
  upload.render = function(options){
    var inst = new Class(options);
    return thisModule.call(inst);
  };
  
  exports(MOD_NAME, upload);
});
Repository: sentsin/layui
File: src/modules/upload.js (JavaScript)

Code before:
        $(this).trigger('upload.over');
      }).on('dragleave', function(e){
        $(this).trigger('upload.leave');
      }).on('drop', function(e){
        e.preventDefault();
        $(this).trigger('upload.drop', e);
      });
    }
    
    // 手动上传时触发上传的元素 click 事件
    options.bindAction.on('click', function(){
      $(this).trigger('upload.action');
    });
    
    // 绑定元素索引
    options.elem.data(MOD_INDEX, options.id);
  };

    /**
   * 上传组件辅助方法
   * @type {{parseSize: ((function((number|float), *=): string)|*)}}
   */
  upload.util = {
    /**
     * 文件大小处理
     * @param {number|float} size -文件大小
     * @param precision
     * @return {string}
     */
    parseSize: function (/*文件大小*/size, precision) {
      precision = precision || 2;
      if (null == size || !size) {
        return '0';
      }
      var unitArr = ["Bytes", "Kb", "Mb", "Gb", "Tb", "Pb", "Eb", "Zb", "Yb"];
      var index;
      var formatSize = typeof value === 'string' ? parseFloat(size + '') : size;
      index = Math.floor(Math.log(formatSize) / Math.log(1024));
      size = formatSize / Math.pow(1024, index);
      size = size % 1 === 0 ? size : parseFloat(size.toFixed(precision));//保留的小数位数
      return size + unitArr[index];
    }
  }

  // 记录所有实例
  thisModule.that = {}; // 记录所有实例对象

  // 获取当前实例对象
  thisModule.getThis = function(id){
    var that = thisModule.that[id];
    if(!that) hint.error(id ? (MOD_NAME +' instance with ID \''+ id +'\' not found') : 'ID argument required');

Review comment (suggestion):
```suggestion
     * @param {number | string} size -文件大小
```

Code after:
        e.preventDefault();
        $(this).trigger('upload.over');
      }).on('dragleave', function(e){
        $(this).trigger('upload.leave');
      }).on('drop', function(e){
        e.preventDefault();
        $(this).trigger('upload.drop', e);
      });
    }
    
    // 手动上传时触发上传的元素 click 事件
    options.bindAction.on('click', function(){
      $(this).trigger('upload.action');
    });
    
    // 绑定元素索引
    options.elem.data(MOD_INDEX, options.id);
  };

  /**
   * 上传组件辅助方法
   */
  upload.util = {
    /**
     * 文件大小处理
     * @param {number | string} size -文件大小
     * @param {number} [precision] - 数值精度
     * @return {string}
     */
    parseSize: function (size, precision) {
      precision = precision || 2;
      if (null == size || !size) {
        return '0';
      }
      var unitArr = ["Bytes", "Kb", "Mb", "Gb", "Tb", "Pb", "Eb", "Zb", "Yb"];
      var index;
      var formatSize = typeof size === 'string' ? parseFloat(size) : size;
      index = Math.floor(Math.log(formatSize) / Math.log(1024));
      size = formatSize / Math.pow(1024, index);
      size = size % 1 === 0 ? size : parseFloat(size.toFixed(precision));//保留的小数位数
      return size + unitArr[index];
    }
  }

  // 记录所有实例
  thisModule.that = {}; // 记录所有实例对象

  // 获取当前实例对象
  thisModule.getThis = function(id){
    var that = thisModule.that[id];
    if(!that) hint.error(id ? (MOD_NAME +' instance with ID \''+ id +'\' not found') : 'ID argument required');
Repository: sentsin/layui
File: src/modules/dropdown.js (JavaScript)

Code before:
  var STR_ELEM_SHADE = 'layui-dropdown-shade';
  
  var STR_GROUP_TITLE = '.'+ STR_ITEM_GROUP + '>.'+ STR_MENU_TITLE;

  // 构造器
  var Class = function(options){
    var that = this;
    that.index = ++dropdown.index;
    that.config = $.extend({}, that.config, dropdown.config, options);
    that.init();
  };

  // 默认配置
  Class.prototype.config = {
    trigger: 'click', // 事件类型
    content: '', // 自定义菜单内容
    className: '', // 自定义样式类名
    style: '', // 设置面板 style 属性
    show: false, // 是否初始即显示菜单面板
    isAllowSpread: true, // 是否允许菜单组展开收缩
    isSpreadItem: true, // 是否初始展开子菜单
    data: [], // 菜单数据结构
    delay: [200, 300], // 延时显示或隐藏的毫秒数，若为 number 类型，则表示显示和隐藏的延迟时间相同，trigger 为 hover 时才生效
    shade: 0, // 遮罩
    accordion: false, // 手风琴效果，仅菜单组生效。基础菜单需要在容器上追加 'lay-accordion' 属性。
    closeOnClick: false // 点击 dropdown 外部时是否关闭，行为取决于所使用的触发事件类型
  };
  
  // 重载实例
  Class.prototype.reload = function(options, type){
    var that = this;
    that.config = $.extend({}, that.config, options);
    that.init(true, type);
  };

  // 初始化准备
  Class.prototype.init = function(rerender, type){
    var that = this;
    var options = that.config;
    
    // 若 elem 非唯一
    var elem = $(options.elem);
    if(elem.length > 1){
      layui.each(elem, function(){
        dropdown.render($.extend({}, options, {
          elem: this
        }));
      });
      return that;
    }


Review comment (suggestion):
```suggestion
    closeOnClick: false // 面板打开后，再次点击目标元素时是否关闭面板。行为取决于所使用的触发事件类型
```

Code after:
  var STR_ELEM_SHADE = 'layui-dropdown-shade';
  
  var STR_GROUP_TITLE = '.'+ STR_ITEM_GROUP + '>.'+ STR_MENU_TITLE;

  // 构造器
  var Class = function(options){
    var that = this;
    that.index = ++dropdown.index;
    that.config = $.extend({}, that.config, dropdown.config, options);
    that.init();
  };

  // 默认配置
  Class.prototype.config = {
    trigger: 'click', // 事件类型
    content: '', // 自定义菜单内容
    className: '', // 自定义样式类名
    style: '', // 设置面板 style 属性
    show: false, // 是否初始即显示菜单面板
    isAllowSpread: true, // 是否允许菜单组展开收缩
    isSpreadItem: true, // 是否初始展开子菜单
    data: [], // 菜单数据结构
    delay: [200, 300], // 延时显示或隐藏的毫秒数，若为 number 类型，则表示显示和隐藏的延迟时间相同，trigger 为 hover 时才生效
    shade: 0, // 遮罩
    accordion: false, // 手风琴效果，仅菜单组生效。基础菜单需要在容器上追加 'lay-accordion' 属性。
    closeOnClick: false // 面板打开后，再次点击目标元素时是否关闭面板。行为取决于所使用的触发事件类型
  };
  
  // 重载实例
  Class.prototype.reload = function(options, type){
    var that = this;
    that.config = $.extend({}, that.config, options);
    that.init(true, type);
  };

  // 初始化准备
  Class.prototype.init = function(rerender, type){
    var that = this;
    var options = that.config;
    
    // 若 elem 非唯一
    var elem = $(options.elem);
    if(elem.length > 1){
      layui.each(elem, function(){
        dropdown.render($.extend({}, options, {
          elem: this
        }));
      });
      return that;
    }
Repository: sentsin/layui
File: src/modules/util.js (JavaScript)

Code before:
      var elem = options.elem = $(options.elem);
      var attrSelector = '['+ attr +']';
      var DATANAME = 'UTIL_ON_DATA'; // 缓存在委托元素上的 data-* 属性名

      if (!elem[0]) return; // 若委托元素不存在

      // 初始化 data 默认值，以委托元素为存储单元
      if (!elem.data(DATANAME)) {
        elem.data(DATANAME, {
          events: {}
        });
      }

      // 读取 data 缓存
      var dataCache = elem.data(DATANAME);

      // 根据 attr 和 trigger 的组合作为 key
      var key = attr + '_' + options.trigger;

      // 根据 key 记录事件集合
      events = dataCache.events[key] = $.extend(true, dataCache.events[key], events);


      // 清除事件委托，避免重复绑定
      var trigger = options.trigger + '.lay_util_on';
      elem.off(options.trigger, attrSelector);

      // 绑定事件委托
      elem.on(trigger, attrSelector, function(e) {
        var othis = $(this);
        var attrValue = othis.attr(attr);
        typeof events[attrValue] === 'function' && events[attrValue].call(this, othis, e);
      });

      return events;
    }
  };

  // 兼容旧版
  util.event = util.on;

  // 输出接口
  exports('util', util);
});


Review comment (suggestion):
```suggestion
      elem.off(trigger, attrSelector);
```

Code after:
      var elem = options.elem = $(options.elem);
      var attrSelector = '['+ attr +']';
      var DATANAME = 'UTIL_ON_DATA'; // 缓存在委托元素上的 data-* 属性名

      if (!elem[0]) return; // 若委托元素不存在

      // 初始化 data 默认值，以委托元素为存储单元
      if (!elem.data(DATANAME)) {
        elem.data(DATANAME, {
          events: {}
        });
      }

      // 读取 data 缓存
      var dataCache = elem.data(DATANAME);

      // 根据 attr 和 trigger 的组合作为 key
      var key = attr + '_' + options.trigger;

      // 根据 key 记录事件集合
      events = dataCache.events[key] = $.extend(true, dataCache.events[key], events);


      // 清除事件委托，避免重复绑定
      var trigger = options.trigger + '.lay_util_on';
      elem.off(trigger, attrSelector);

      // 绑定事件委托
      elem.on(trigger, attrSelector, function(e) {
        var othis = $(this);
        var attrValue = othis.attr(attr);
        typeof events[attrValue] === 'function' && events[attrValue].call(this, othis, e);
      });

      return events;
    }
  };

  // 兼容旧版
  util.event = util.on;

  // 输出接口
  exports('util', util);
});
Repository: sentsin/layui
File: src/modules/table.js (JavaScript)

Code before:
  }

  /**
   * 获取元素 content 区域宽度值
   * @param {JQuery} elem - 元素的 jQuery 对象
   */
  Class.prototype.getContentWidth = function(elem){
    var that = this;

    if(!window.getComputedStyle){
      // IE 中的 `currentStyle` 获取未显式设置的宽高时会得到 'auto'，jQuery 中有一些 hack 方法获取准确值
      return elem.width();
    }else{
      var size = that.getElementSize(elem[0]);
      // IE BUG
      // border-box: getComputedStyle 得到的 width/height 是按照 content-box 计算出来的
      return (size.boxSizing === 'border-box' && !lay.ie)
        ? size.width - size.paddingLeft - size.paddingRight - size.borderLeftWidth - size.borderRightWidth
        : size.width
    }
  }
  
  Class.prototype.autoResize = function(){
    var that = this;

    // 可能要主动包裹一层检测大小的元素，在 table 视图元素检测并不可靠
    // var targetElem = that.elem.parent('.layui-table-auto-resize')[0] || that.elem;
    that.resizeStrategy(that.elem);
  }

  Class.prototype.resizeStrategy = function(){
    // chrome 64+
    if(window.ResizeObserver){
      return function(targetElem){
        var that = this;
        // 不需要每次创建 observer 实例，只是为了简化实现
        if(that.resizeObserver){
          that.resizeObserver.disconnect();
          that.resizeObserver = null;
        }
        that.resizeObserver = new ResizeObserver(function(){
          that.resize();
        });
        that.resizeObserver.observe(targetElem[0]);
      }
    }

    // IE8 支持元素 resize 事件
    if(lay.ie === '8'){
      return function(targetElem){
        var that = this;

Review comment (suggestion):
```js
 // 检测 table 视图元素不可靠，是因为 table 高度由 table-main 元素决定
<div class="layui-table-auto-resize"> // 默认宽高 100%
  <table id="tb"></table>
</div>
```

Code after:
  }

  /**
   * 获取元素 content 区域宽度值
   * @param {JQuery} elem - 元素的 jQuery 对象
   */
  Class.prototype.getContentWidth = function(elem){
    var that = this;

    if(!window.getComputedStyle){
      // IE 中的 `currentStyle` 获取未显式设置的宽高时会得到 'auto'，jQuery 中有一些 hack 方法获取准确值
      return elem.width();
    }else{
      var size = that.getElementSize(elem[0]);
      // IE BUG
      // border-box: getComputedStyle 得到的 width/height 是按照 content-box 计算出来的
      return (size.boxSizing === 'border-box' && !lay.ie)
        ? size.width - size.paddingLeft - size.paddingRight - size.borderLeftWidth - size.borderRightWidth
        : size.width
    }
  }
  
  Class.prototype.autoResize = function(){
    var that = this;

    that.resizeStrategy(that.elem);
  }

  Class.prototype.resizeStrategy = function(){
    // chrome 64+
    if(window.ResizeObserver){
      return function(targetElem){
        var that = this;
        if(that.resizeObserver){
          that.resizeObserver.disconnect();
          that.resizeObserver = null;
        }
        that.resizeObserver = new ResizeObserver(function(){
          that.resize();
        });
        that.resizeObserver.observe(targetElem[0]);
      }
    }

    // IE8 支持元素 resize 事件
    if(lay.ie === '8'){
      return function(targetElem){
        var that = this;
        targetElem.off('resize.lay-table-autoresize')
          .on('resize.lay-table-autoresize', function(){
            that.resize();
Repository: sharkdp/hyperfine
File: src/main.rs (Rust)

Code before:

use std::cmp;
use std::error::Error;
use std::io;

use atty::Stream;
use colored::*;
use clap::{App, AppSettings, Arg};

mod hyperfine;

use hyperfine::internal::{CmdFailureAction, HyperfineOptions, OutputStyleOption};
use hyperfine::benchmark::{mean_shell_spawning_time, run_benchmark};
use hyperfine::export::{create_export_manager, ExportManager, ResultExportType};

/// Print error message to stderr and terminate
pub fn error(message: &str) -> ! {
    eprintln!("{} {}", "Error:".red(), message);
    std::process::exit(1);
}

/// Runs the benchmark for the given commands
fn run(
    commands: &Vec<&str>,
    options: &HyperfineOptions,
    exporter: &mut Option<Box<ExportManager>>,
) -> io::Result<()> {
    let shell_spawning_time = mean_shell_spawning_time(&options.output_style)?;

    // Run the benchmarks
    for (num, cmd) in commands.iter().enumerate() {
        run_benchmark(num, cmd, shell_spawning_time, options, exporter)?;
    }

    Ok(())
}

fn main() {
    // Process command line options
    let mut options = HyperfineOptions::default();

    let clap_color_setting = if atty::is(Stream::Stdout) {
        AppSettings::ColoredHelp
    } else {
        AppSettings::ColorNever
    };

    let matches = App::new("hyperfine")
        .version(crate_version!())
        .setting(clap_color_setting)
        .setting(AppSettings::DeriveDisplayOrder)

Review comment (suggestion):
Same as above: I would rather like `run` to return the results instead of passing a mutable `ExportManager`.

Code after:

use std::cmp;
use std::error::Error;
use std::io;

use atty::Stream;
use colored::*;
use clap::{App, AppSettings, Arg};

mod hyperfine;

use hyperfine::internal::{CmdFailureAction, HyperfineOptions, OutputStyleOption};
use hyperfine::benchmark::{mean_shell_spawning_time, run_benchmark};
use hyperfine::export::{create_export_manager, ExportEntry, ResultExportType};

/// Print error message to stderr and terminate
pub fn error(message: &str) -> ! {
    eprintln!("{} {}", "Error:".red(), message);
    std::process::exit(1);
}

/// Runs the benchmark for the given commands
fn run(commands: &Vec<&str>, options: &HyperfineOptions) -> io::Result<Vec<ExportEntry>> {
    let shell_spawning_time = mean_shell_spawning_time(&options.output_style)?;

    let mut timing_results = vec![];

    // Run the benchmarks
    for (num, cmd) in commands.iter().enumerate() {
        timing_results.push(run_benchmark(num, cmd, shell_spawning_time, options)?);
    }

    Ok(timing_results)
}

fn main() {
    // Process command line options
    let mut options = HyperfineOptions::default();

    let clap_color_setting = if atty::is(Stream::Stdout) {
        AppSettings::ColoredHelp
    } else {
        AppSettings::ColorNever
    };

    let matches = App::new("hyperfine")
        .version(crate_version!())
        .setting(clap_color_setting)
        .setting(AppSettings::DeriveDisplayOrder)
        .setting(AppSettings::UnifiedHelpMessage)
        .max_term_width(90)
Repository: sharkdp/hyperfine
File: src/hyperfine/export/mod.rs (Rust)

Code before:
        mean: Second,
        stddev: Second,
        user: Second,
        system: Second,
        min: Second,
        max: Second,
    ) -> Self {
        ExportEntry {
            command,
            mean,
            stddev,
            user,
            system,
            min,
            max,
        }
    }
}

/// The ResultExportType enum is used to denote the desired form
/// of exporter to use for a given file.
pub enum ResultExportType {
    /// Export to a csv file with the provided name
    Csv(String),
}

/// A ResultExporter is responsible for writing all results to the
/// appropriate file
trait ResultExporter {
    /// Write all entries to the target destination
    fn write(&self, values: &Vec<ExportEntry>) -> Result<()>;
}

/// Create a new ExportManager
pub fn create_export_manager() -> ExportManager {
    ExportManager {
        exporters: Vec::new(),
    }
}

/// The Exporter is the internal implementation of the ExportManager
pub struct ExportManager {
    exporters: Vec<Box<ResultExporter>>,
}

impl ExportManager {
    pub fn add_exporter(&mut self, for_type: &ResultExportType) {
        match for_type {
            &ResultExportType::Csv(ref file_name) => self.exporters
                .push(Box::from(CsvExporter::new(file_name.clone()))),
        };

Review comment (suggestion):
Maybe consider using this `enum` just to track the type of export and pass the file path as a separate argument? Just a thought.

Code after:
    /// Create a new ExportEntry with the given values
    pub fn new(
        command: String,
        mean: Second,
        stddev: Second,
        user: Second,
        system: Second,
        min: Second,
        max: Second,
    ) -> Self {
        ExportEntry {
            command,
            mean,
            stddev,
            user,
            system,
            min,
            max,
        }
    }
}

/// The ResultExportType enum is used to denote the desired form
/// of exporter to use for a given file.
#[derive(Clone)]
pub enum ResultExportType {
    /// Export to a csv file with the provided name
    Csv(String),
    /// Export to a JSON file
    Json(String),
}

/// A ResultExporter is responsible for writing all results to the
/// appropriate file
trait ResultExporter {
    /// Write all entries to the target destination
    fn write(&self, values: &Vec<ExportEntry>) -> Result<Vec<u8>>;
}

/// Create a new ExportManager
pub fn create_export_manager() -> ExportManager {
    ExportManager {
        exporters: Vec::new(),
    }
}

/// The ExportManager handles the management of multiple file
/// exporters.
pub struct ExportManager {
    exporters: Vec<ResultExportType>,
}
Repository: sharkdp/hyperfine
File: src/hyperfine/app.rs (Rust)

Code before:
                .long("export-csv")
                .takes_value(true)
                .value_name("FILE")
                .help("Export the timing results as CSV to the given FILE."),
        )
        .arg(
            Arg::with_name("export-json")
                .long("export-json")
                .takes_value(true)
                .value_name("FILE")
                .help("Export the timing results as JSON to the given FILE."),
        )
        .arg(
            Arg::with_name("export-markdown")
                .long("export-markdown")
                .takes_value(true)
                .value_name("FILE")
                .help("Export the timing results as a Markdown table to the given FILE."),
        )
        .arg(
            Arg::with_name("print-stdout")
                .long("print-stdout")
                .conflicts_with("style")
                .help("Print the stdout of the benchmark instead of suppressing it. \
                       This will increase the time it takes for benchmarks to run, \
                       so it should only be used when trying to benchmark output speed."),
        )
        .help_message("Print this help message.")
        .version_message("Show version information.")
}


Review comment (bug):
maybe add ".. only be used for debug purposes or when trying to ..."?

Code after:
                .long("export-csv")
                .takes_value(true)
                .value_name("FILE")
                .help("Export the timing results as CSV to the given FILE."),
        )
        .arg(
            Arg::with_name("export-json")
                .long("export-json")
                .takes_value(true)
                .value_name("FILE")
                .help("Export the timing results as JSON to the given FILE."),
        )
        .arg(
            Arg::with_name("export-markdown")
                .long("export-markdown")
                .takes_value(true)
                .value_name("FILE")
                .help("Export the timing results as a Markdown table to the given FILE."),
        )
        .arg(
            Arg::with_name("show-output")
                .long("show-output")
                .conflicts_with("style")
                .help("Print the stdout and stderr of the benchmark instead of suppressing it. \
                       This will increase the time it takes for benchmarks to run, \
                       so it should only be used for debugging purposes or \
                       when trying to benchmark output speed."),
        )
        .help_message("Print this help message.")
        .version_message("Show version information.")
}