Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
See what's new at GitLab
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
P
pager-rs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
6
Issues
6
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Cyril Plisko
pager-rs
Commits
177ddf19
Commit
177ddf19
authored
Dec 11, 2017
by
Cyril Plisko
🤔
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deprecate 'Pager::skip_on_notty()'
parent
e540854e
Pipeline
#14984486
failed with stage
in 1 minute and 10 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
src/lib.rs
src/lib.rs
+10
-0
tests/pager.rs
tests/pager.rs
+9
-2
No files found.
src/lib.rs
View file @
177ddf19
...
...
@@ -126,6 +126,7 @@ impl Pager {
}
/// Instructs `Pager` to bypass invoking pager if output is not a `tty`
#[deprecated(since
=
"0.14.0"
,
note
=
"'skip_on_notty' is default now"
)]
pub
fn
skip_on_notty
(
self
)
->
Self
{
Self
{
skip_on_notty
:
true
,
...
...
@@ -133,6 +134,15 @@ impl Pager {
}
}
/// Instructs `Pager` to force invoking pager even if output is not a `tty`
#[doc(hidden)]
pub
fn
force_on_notty
(
self
)
->
Self
{
Self
{
skip_on_notty
:
false
,
..
self
}
}
/// Gives quick assessment of successful `Pager` setup
pub
fn
is_on
(
&
self
)
->
bool
{
self
.on
...
...
tests/pager.rs
View file @
177ddf19
...
...
@@ -14,8 +14,15 @@ fn nopager() {
}
#[test]
fn
notty
()
{
let
mut
pager
=
Pager
::
new
()
.skip_on_notty
()
;
fn
skip_on_
notty
()
{
let
mut
pager
=
Pager
::
new
();
pager
.setup
();
assert
!
(
!
pager
.is_on
());
}
#[test]
fn
force_on_notty
()
{
let
mut
pager
=
Pager
::
new
()
.force_on_notty
();
pager
.setup
();
assert
!
(
pager
.is_on
());
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment