Skip to content

Commit

Permalink
behead: we don't need --delimiter to behead
Browse files Browse the repository at this point in the history
  • Loading branch information
jqnatividad committed Oct 14, 2022
1 parent 00e2a73 commit 9599db2
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/cmd/behead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,22 @@ Usage:
Common options:
-h, --help Display this message
-o, --output <file> Write output to <file> instead of stdout.
-d, --delimiter <arg> The field delimiter for reading CSV data.
Must be a single character. (default: ,)
";

use serde::Deserialize;

use crate::{
config::{Config, Delimiter},
util, CliResult,
};
use crate::{config::Config, util, CliResult};

#[derive(Deserialize)]
struct Args {
arg_input: Option<String>,
flag_delimiter: Option<Delimiter>,
flag_output: Option<String>,
arg_input: Option<String>,
flag_output: Option<String>,
}

pub fn run(argv: &[&str]) -> CliResult<()> {
let args: Args = util::get_args(USAGE, argv)?;
let conf = Config::new(&args.arg_input)
.checkutf8(false)
.delimiter(args.flag_delimiter)
.no_headers(false);

let mut rdr = conf.reader()?;
Expand Down

0 comments on commit 9599db2

Please sign in to comment.