// Copyright (c) 2022 silt // SPDX-License-Identifier: AGPL-3.0-or-later use std::env; use std::fs::File; use std::io::{BufReader, BufRead, Write, stdin}; fn main() -> Result<(), Box>{ let mut args: Vec = env::args().skip(1).collect(); println!("Args: {:#?}", args); let mut delim = '\t'; let mut field = 1; let mut file = stdin(); match args.first().unwrap().as_str() { mode if ["-b", "-c", "-f"].iter().any(|&s| s == mode) => { let list = args.get(1).unwrap(); if !list.chars().all(|s| "0123456789-, ".contains(s)) { std::process::exit(1); } } _ => { std::process::exit(1) } } Ok(()) }