Skip to content

Commit

Permalink
General --line-buffered support (#336)
Browse files Browse the repository at this point in the history
* tsv-append --line-buffered suport.

* bufferedByLine et al read header lines immediately. Used by tsv-select, tsv-append to immediately write header.

* number-lines immediate read & write of header line.

* tsv-join --line-buffered

* Refactor line-buffered code. Add tsv-uniq --line-buffered support.

* tsv-sample --line-buffered support.

* bash-completion for tsv-sample --line-buffered.

* bash-completion for tsv-append --line-buffered.
  • Loading branch information
jondegenhardt authored Mar 8, 2021
1 parent 2ad7346 commit 41ed15a
Show file tree
Hide file tree
Showing 17 changed files with 967 additions and 425 deletions.
8 changes: 4 additions & 4 deletions bash_completion/tsv-utils
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ _tsv_append()
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="--help --help-verbose --version --header --track-source --source-header --file --delimiter"
opts="--help --help-verbose --version --header --track-source --source-header --file --delimiter --line-buffered"

# Options requiring an argument or precluding other options
case $prev in
Expand Down Expand Up @@ -124,7 +124,7 @@ _tsv_join()
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="--help --help-verbose --help-fields --version --filter-file --key-fields --data-fields --append-fields --header --prefix --write-all --exclude --delimiter --allow-duplicate-keys"
opts="--help --help-verbose --help-fields --version --filter-file --key-fields --data-fields --append-fields --header --prefix --write-all --exclude --delimiter --allow-duplicate-keys --line-buffered"

# Options requiring an argument or precluding other options
# Options requiring a filename argument are handled in their own case match, ie. -f|--filter-file
Expand Down Expand Up @@ -181,7 +181,7 @@ _tsv_sample()
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="--help --help-verbose --help-fields --version --header --num --prob --weight-field --key-fields --replace --inorder --print-random --gen-random-inorder --compatibility-mode --static-seed --seed-value --delimiter --prefer-skip-sampling --prefer-algorithm-r"
opts="--help --help-verbose --help-fields --version --header --num --prob --weight-field --key-fields --replace --inorder --print-random --gen-random-inorder --compatibility-mode --static-seed --seed-value --delimiter --line-buffered --prefer-skip-sampling --prefer-algorithm-r"

# Options requiring an argument or precluding other options
case $prev in
Expand Down Expand Up @@ -286,7 +286,7 @@ _tsv_uniq()
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="--help --help-verbose --help-fields --version --header --fields --ignore-case --repeated --at-least --max --number --equiv --equiv-header --equiv-start --delimiter"
opts="--help --help-verbose --help-fields --version --header --fields --ignore-case --repeated --at-least --max --number --equiv --equiv-header --equiv-start --delimiter --line-buffered"

# Options requiring an argument or precluding other options
case $prev in
Expand Down
Loading

0 comments on commit 41ed15a

Please sign in to comment.