2023-10-07 13:07:18 +02:00
|
|
|
|
::cut OPTION... [FILE]... {
|
|
|
|
|
|
|
|
|
|
match OPTION... {
|
|
|
|
|
--help { <1 : Help~<Seq Char> ; }
|
2023-10-30 15:30:42 +01:00
|
|
|
|
--version { <1 : VersionInfo~<Seq Char> ; }
|
2023-10-07 13:07:18 +02:00
|
|
|
|
|
|
|
|
|
* {
|
2023-10-30 15:30:42 +01:00
|
|
|
|
match OPTION... {
|
|
|
|
|
-f--fields LIST:<Seq ℕ>~CutFieldList~<Seq Char> {
|
2023-10-07 13:07:18 +02:00
|
|
|
|
|
|
|
|
|
ROW-DELIM =
|
|
|
|
|
match OPTION... {
|
|
|
|
|
-z--zero-terminated { '\0' }
|
|
|
|
|
* { '\n' }
|
2023-10-30 15:30:42 +01:00
|
|
|
|
};
|
2023-10-07 13:07:18 +02:00
|
|
|
|
|
|
|
|
|
IN-COL-DELIM =
|
|
|
|
|
match OPTION... {
|
|
|
|
|
-d--delimiter DELIM:Char { DELIM }
|
|
|
|
|
* { '\t' }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
OUT-COL-DELIM =
|
|
|
|
|
match OPTION... {
|
2023-10-30 15:30:42 +01:00
|
|
|
|
--output-delimiter STRING:<Seq Char> { STRING }
|
|
|
|
|
* { IN-COL-DELIM }
|
|
|
|
|
};
|
2023-10-07 13:07:18 +02:00
|
|
|
|
|
|
|
|
|
FILE : Path
|
|
|
|
|
~<Seq PathSegment
|
|
|
|
|
~<Seq Char>>
|
|
|
|
|
~<SepSeq Char '/'>
|
|
|
|
|
~<Seq Char> ;
|
|
|
|
|
|
|
|
|
|
@FILE : <Seq <* < ITEM~<Seq Char> >... >
|
|
|
|
|
~<Seq <Seq Char>>
|
|
|
|
|
~<SepSeq Char IN-COL-DELIM>
|
|
|
|
|
~<Seq Char>>
|
|
|
|
|
~<SepSeq Char ROW-DELIM>
|
|
|
|
|
~<Seq Char> ;
|
|
|
|
|
|
|
|
|
|
>0 : <Seq <* <ITEM~<Seq Char>>... >
|
|
|
|
|
~<Seq <Seq Char>>
|
|
|
|
|
~<SepSeq Char IN-COL-DELIM>
|
|
|
|
|
~<Seq Char>>
|
|
|
|
|
~<SepSeq Char ROW-DELIM>
|
|
|
|
|
~<Seq Char> ;
|
|
|
|
|
|
|
|
|
|
# `[LIST]` means `select all fields contained in LIST from parameter pack`
|
|
|
|
|
<1 : <Seq <* <ITEM~<Seq Char>>[LIST]... >
|
|
|
|
|
~<Seq <Seq Char>>
|
|
|
|
|
~<SepSeq Char OUT-COL-DELIM>
|
|
|
|
|
~<Seq Char>>
|
|
|
|
|
~<SepSeq Char ROW-DELIM>
|
|
|
|
|
~<Seq Char> ;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
* {
|
|
|
|
|
<1 : Nothing ;
|
|
|
|
|
<2 : MissingFields~ErrorMessage~<Seq Char> ;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|