#![allow(unused_imports, dead_code)]
use clap::{Arg, ArgAction, Command, builder::ValueParser};
use std::ffi::OsString;
use std::ops::RangeInclusive;
use std::str::FromStr;
mod options {
pub static BEFORE: &str = "before";
pub static REGEX: &str = "regex";
pub static SEPARATOR: &str = "separator";
pub static FILE: &str = "file";
}
fn format_usage(s: &str) -> String {
s.to_string()
}
pub fn tac_command() -> Command {
Command::new("tac")
.version(env!("CARGO_PKG_VERSION"))
.override_usage(format_usage(&::std::string::String::from(
"tac [OPTION]... [FILE]...",
)))
.about(::std::string::String::from(
"Write each file to standard output, last line first.",
))
.infer_long_args(true)
.arg(
Arg::new(options::BEFORE)
.short('b')
.long(options::BEFORE)
.help(::std::string::String::from(
"attach the separator before instead of after",
))
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::REGEX)
.short('r')
.long(options::REGEX)
.help(::std::string::String::from(
"interpret the sequence as a regular expression",
))
.action(ArgAction::SetTrue),
)
.arg(
Arg::new(options::SEPARATOR)
.short('s')
.long(options::SEPARATOR)
.help(::std::string::String::from(
"use STRING as the separator instead of newline",
))
.value_parser(clap::value_parser!(OsString))
.value_name("STRING"),
)
.arg(
Arg::new(options::FILE)
.hide(true)
.action(ArgAction::Append)
.value_parser(clap::value_parser!(OsString))
.value_hint(clap::ValueHint::FilePath),
)
}