Class Pager
- Namespace
- McMaster.Extensions.CommandLineUtils
- Assembly
- McMaster.Extensions.CommandLineUtils.dll
Process access to a console pager, which supports scrolling and search.
This is done by piping into `less` command (Linux/macOS only.) Windows is currently not supported.
public class Pager : IDisposable
- Inheritance
-
objectPager
- Implements
Constructors
Pager()
Initializes a new instance of Pager which displays output in a console pager.
public Pager()
Pager(IConsole)
Initializes a new instance of Pager which displays output in a console pager.
public Pager(IConsole console)
Parameters
consoleIConsoleThe console to write to.
Properties
Prompt
The prompt to display at the bottom of the pager. https://www.computerhope.com/unix/uless.htm#Prompts for details.
public string Prompt { get; set; }
Property Value
Writer
Gets an object which can be used to write text into the pager.
This falls back to Out if the pager is not available.
public TextWriter Writer { get; }
Property Value
Methods
Dispose()
This will wait until the user exits the pager.
public void Dispose()
Kill()
Force close the pager.
public void Kill()
WaitForExit()
This will wait until the user exits the pager.
public void WaitForExit()