Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement pr (resurrection of the resurrected PR) #2300

Merged
merged 64 commits into from
May 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
2d58ea5
pr: print 56 lines of content with 5 blank trailer and header lines
tilakpatidar Dec 8, 2018
2ee90ab
pr: print pr header with file last modified time, path and page number
tilakpatidar Dec 8, 2018
9111f16
pr: add -h to print header and -n to print line numbers
tilakpatidar Dec 8, 2018
7f87e42
pr: add support for multiple files
tilakpatidar Dec 9, 2018
e69c9ad
pr: read from stdin
tilakpatidar Dec 10, 2018
2d609b2
pr: add custom errors
tilakpatidar Dec 10, 2018
781d77e
pr: add support for -d option
tilakpatidar Dec 12, 2018
77d3d08
pr: show current time for stdin input
tilakpatidar Dec 12, 2018
1cf84a7
pr: refactor option flags into constants
tilakpatidar Dec 12, 2018
8c7cbf6
pr: throw error on reading from socket
tilakpatidar Dec 12, 2018
420a066
pr: add read buffer size and fix unused Result types
tilakpatidar Dec 12, 2018
c58ee96
pr: add long names for -d and -h
tilakpatidar Dec 12, 2018
9a3c572
pr: add --page option
tilakpatidar Dec 12, 2018
55043d7
pr: print only 28 lines if double spaced option is used
tilakpatidar Dec 12, 2018
9e023b8
pr: add -t option to not print header, trailer and -l to print line n…
tilakpatidar Dec 13, 2018
fd44477
pr: add -r option to suppress errors and -F to use form feed separator
tilakpatidar Dec 13, 2018
0098cfe
pr: add ColumnModeOptions and fix reading of input after page range i…
tilakpatidar Dec 14, 2018
2897039
pr: fix number of lines printed per page and short pages getting skipped
tilakpatidar Dec 14, 2018
f799d22
pr: add multi column printing
tilakpatidar Dec 15, 2018
629236b
pr: add first test
tilakpatidar Dec 15, 2018
64e2e1d
pr: remove parameter header and get_input_type
tilakpatidar Dec 15, 2018
afc58eb
pr: add tests for -n -h -d option
tilakpatidar Dec 15, 2018
88ec02a
pr: add suport for -n [char][width] and -N
tilakpatidar Dec 16, 2018
b742230
pr: fix page ranges
tilakpatidar Dec 16, 2018
b578bb6
pr: add test for -t -l -r option
tilakpatidar Dec 16, 2018
f367657
pr: print padded string for each column and handle tab issues
tilakpatidar Dec 17, 2018
5705ed1
pr: write pagination logic of reading file using iterators
tilakpatidar Dec 19, 2018
d9084a7
pr: implement across option and fix tests
tilakpatidar Dec 20, 2018
f497fb9
pr: read from stdin
tilakpatidar Dec 22, 2018
69371ce
pr: add tests for --column with across option
tilakpatidar Dec 22, 2018
dd07aed
pr: add column separator option
tilakpatidar Dec 22, 2018
5956894
pr: add -m and -o option
tilakpatidar Dec 24, 2018
5c6c524
pr: refactor and fmt fill_missing_lines and error checks
tilakpatidar Dec 29, 2018
847046f
pr: add +page and -column
tilakpatidar Dec 30, 2018
87227ad
pr: fix printing form feed
tilakpatidar Dec 30, 2018
8f9b322
pr: fix file not found in pr and mpr
tilakpatidar Dec 30, 2018
3be5dc6
pr: fix form feed
tilakpatidar Jan 4, 2019
4bf5b86
pr: add last page option in +page
tilakpatidar Jan 4, 2019
a4b7232
pr: add more tests for form feed and include page_width option W
tilakpatidar Jan 6, 2019
40e7f3d
pr: add -J and -S option
tilakpatidar Jan 6, 2019
aefc2eb
pr: reformat with rustfmt
tilakpatidar Jan 13, 2019
a7def93
pr: refactor common iterator between pr and mpr
tilakpatidar Jan 14, 2019
f87ada5
pr: refactor logic for -n <path>
tilakpatidar Jan 16, 2019
054c05d
pr: refactor get_lines_for_printing, write_columns, recreate_arguments
tilakpatidar Jan 17, 2019
837780c
pr: pre PR tasks
tilakpatidar Jan 21, 2019
75b35e6
pr: remove not required tests
tilakpatidar Apr 28, 2019
62fe688
pr: Fixes after rebasing
MaxSem Mar 26, 2021
bc2b385
pr: Fix a bunch of Clippy problems
MaxSem Mar 26, 2021
9e75926
pr: Remove commented out stuff from Cargo.toml
MaxSem Mar 26, 2021
844e318
Merge branch 'master' into pr
sylvestre Apr 9, 2021
0487360
pr: make tests compile again
tertsdiepraam May 29, 2021
d94ee87
pr: move options into mod
tertsdiepraam May 29, 2021
12287fc
pr: fix clippy lints
tertsdiepraam May 29, 2021
0913a77
pr: let type inference do its works
tertsdiepraam May 29, 2021
2e1035b
pr: static to const
tertsdiepraam May 29, 2021
4744b35
pr: explicit none in match expressions
tertsdiepraam May 29, 2021
bc1870c
Merge branch 'master' into pr
tertsdiepraam May 29, 2021
b0bf3e7
pr: rustfmt test_pr.rs and utils.rs
tertsdiepraam May 29, 2021
a54fc7a
pr: remove unused asref implementations
tertsdiepraam May 29, 2021
f9bc80e
pr: remove comments that are obvious through types
tertsdiepraam May 29, 2021
f787326
pr: add to GNUMakefile
tertsdiepraam May 30, 2021
6c4479f
pr: add to other list in GNUMakefile
tertsdiepraam May 31, 2021
77a0a07
pr: update dependencies
tertsdiepraam May 31, 2021
7690dc0
Merge branch 'master' into pr
tertsdiepraam May 31, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
75 changes: 36 additions & 39 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ feat_common_core = [
"nl",
"od",
"paste",
"pr",
"printenv",
"printf",
"ptx",
Expand Down Expand Up @@ -285,6 +286,7 @@ od = { optional=true, version="0.0.6", package="uu_od", path="src/uu/od" }
paste = { optional=true, version="0.0.6", package="uu_paste", path="src/uu/paste" }
pathchk = { optional=true, version="0.0.6", package="uu_pathchk", path="src/uu/pathchk" }
pinky = { optional=true, version="0.0.6", package="uu_pinky", path="src/uu/pinky" }
pr = { optional=true, version="0.0.6", package="uu_pr", path="src/uu/pr" }
printenv = { optional=true, version="0.0.6", package="uu_printenv", path="src/uu/printenv" }
printf = { optional=true, version="0.0.6", package="uu_printf", path="src/uu/printf" }
ptx = { optional=true, version="0.0.6", package="uu_ptx", path="src/uu/ptx" }
Expand Down Expand Up @@ -334,6 +336,7 @@ yes = { optional=true, version="0.0.6", package="uu_yes", path="src/uu/yes"
#pin_cc = { version="1.0.61, < 1.0.62", package="cc" } ## cc v1.0.62 has compiler errors for MinRustV v1.32.0, requires 1.34 (for `std::str::split_ascii_whitespace()`)

[dev-dependencies]
chrono = "0.4.11"
conv = "0.3"
filetime = "0.2"
glob = "0.3.0"
Expand Down
2 changes: 2 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ PROGS := \
nproc \
od \
paste \
pr \
printenv \
printf \
ptx \
Expand Down Expand Up @@ -188,6 +189,7 @@ TEST_PROGS := \
paste \
pathchk \
pinky \
pr \
printf \
ptx \
pwd \
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,12 +337,12 @@ To contribute to uutils, please see [CONTRIBUTING](CONTRIBUTING.md).
| Done | Semi-Done | To Do |
|-----------|-----------|--------|
| arch | cp | chcon |
| base32 | expr | dd |
| base64 | install | numfmt |
| basename | ls | pr |
| cat | more | runcon |
| chgrp | od (`--strings` and 128-bit data types missing) | stty |
| chmod | printf | |
| base32 | expr | csplit |
| base64 | install | dd |
| basename | ls | df |
| cat | more | numfmt |
| chgrp | od (`--strings` and 128-bit data types missing) | runcon |
| chmod | printf | stty |
| chown | sort | |
| chroot | split | |
| cksum | tail | |
Expand All @@ -351,7 +351,7 @@ To contribute to uutils, please see [CONTRIBUTING](CONTRIBUTING.md).
| cut | join | |
| dircolors | df | |
| dirname | tac | |
| du | | |
| du | pr | |
| echo | | |
| env | | |
| expand | | |
Expand Down
30 changes: 30 additions & 0 deletions src/uu/pr/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[package]
name = "uu_pr"
version = "0.0.6"
authors = ["uutils developers"]
license = "MIT"
description = "pr ~ (uutils) convert text files for printing"

homepage = "https://github.com/uutils/coreutils"
repository = "https://github.com/uutils/coreutils/tree/master/src/uu/pr"
keywords = ["coreutils", "uutils", "cross-platform", "cli", "utility"]
categories = ["command-line-utilities"]
edition = "2018"

[lib]
path = "src/pr.rs"

[dependencies]
uucore = { version=">=0.0.7", package="uucore", path="../../uucore", features=["utmpx", "entries"] }
uucore_procs = { version=">=0.0.5", package="uucore_procs", path="../../uucore_procs" }
getopts = "0.2.21"
time = "0.1.41"
# A higher version would cause a conflict with time
chrono = "0.4.19"
quick-error = "2.0.1"
itertools = "0.10"
regex = "1.0"

[[bin]]
name = "pr"
path = "src/main.rs"
1 change: 1 addition & 0 deletions src/uu/pr/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uucore_procs::main!(uu_pr); // spell-checker:ignore procs uucore