fix imports update readme

main
blob42 8 months ago
parent f29d8c449a
commit 7494d1ca3f

@ -19,12 +19,12 @@ input:
|--------------------------| |--------------|
/long/path/to/some/ebook.pdf | Title Of Ebook
____
\
example usage: \
-------------- \__________________
___\_
colmap --field-1='basename {}' --field-2="awk { print $1 }"
_________________|: x-arg
|
example usage: | x:arg
-------------- |
----------------
colmap 'basename {}' "awk { print $1 }"
#OR
colmap -f1 'basename {}' -f2 'awk { print $1 }'
@ -45,20 +45,14 @@ foo_cmd | colmap --field-1='basename {}' --field-2="awk { print $1 }"
foo_cmd | colmap -f1 'basename {}' -f2 'awk { print $1 }'
```
2. Passing an `xarg template`
2. Passing `xargs` as positional arguments
```shell
foo_cmd | colmap -t 'basename {}' 'awk { print $2 }'
foo_cmd | colmap 'basename {}' 'awk { print $2 }'
```
---
[I am using Github under protest](protest.md)
TODO:
----
[ ] use golden tests
[ ] use non-dashed cli like (rwxrob/bonzai)

@ -5,8 +5,14 @@ use regex::Regex;
use std::result;
use std::ops::Index;
use std::slice::SliceIndex;
use crate::parsing::DEFAULT_SEP_PATTERN;
pub const DEFAULT_SEP_PATTERN: &str = r"[\t]+";
pub mod parsing {
pub const DEFAULT_SEP_PATTERN: &str = r"[\t]+";
}
type Column = Vec<String>;

@ -7,7 +7,7 @@
*/
use clap::Parser;
use colmap::DEFAULT_SEP_PATTERN;
use colmap::parsing::DEFAULT_SEP_PATTERN;
#[derive(Parser)]
/// colmap - map commands to columns of text input
@ -22,8 +22,8 @@ use colmap::DEFAULT_SEP_PATTERN;
struct Cli {
/// separator character used to split text into columns
#[arg(default_value_t=DEFAULT_SEP_PATTERN.to_owned())]
#[arg(short, long = "sep")]
separator: String,
#[arg(short)]
delimiter: String,
#[arg(short, long, action = clap::ArgAction::Count)]
debug: u8,
@ -41,7 +41,7 @@ fn main() {
// }
if cli.debug > 0 {
println!("{:?}", cli.separator);
println!("{:?}", cli.delimiter);
}
for c in cli.commands {

Loading…
Cancel
Save