mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 17:19:03 -04:00
view: support -k to inhibit alternate screen #551
This commit is contained in:
parent
92ea6bac6f
commit
6e8a0bebae
@ -8,7 +8,7 @@ notcurses-view - Render images and video to the console
|
||||
|
||||
# SYNOPSIS
|
||||
|
||||
**notcurses-view** [**-h|--help**] [**-d delaymult**] [**-l loglevel**] [**-s scalemode**] files
|
||||
**notcurses-view** [**-h|--help**] [**-d delaymult**] [**-l loglevel**] [**-s scalemode**] [**-k**] files
|
||||
|
||||
# DESCRIPTION
|
||||
|
||||
@ -23,6 +23,8 @@ and videos to the terminal. Media will be scaled to the terminal's size.
|
||||
|
||||
**-s scalemode**: Scaling mode, one of **none**, **scale**, or **stretch**.
|
||||
|
||||
**-k**: Inhibit use of the alternate screen. Necessary if you want the output left on your terminal after the program exits.
|
||||
|
||||
files: Select which files to render, and what order to render them in.
|
||||
|
||||
# NOTES
|
||||
|
@ -17,7 +17,8 @@ static void usage(std::ostream& os, const char* name, int exitcode)
|
||||
__attribute__ ((noreturn));
|
||||
|
||||
void usage(std::ostream& o, const char* name, int exitcode){
|
||||
o << "usage: " << name << " [ -h ] [ -l loglevel ] [ -d mult ] [ -s scaling ] files" << '\n';
|
||||
o << "usage: " << name << " [ -h ] [ -l loglevel ] [ -d mult ] [ -s scaletype ] [ -k ] files" << '\n';
|
||||
o << " -k: don't use the alternate screen\n";
|
||||
o << " -l loglevel: integer between 0 and 9, goes to stderr'\n";
|
||||
o << " -s scaletype: one of 'none', 'scale', or 'stretch'\n";
|
||||
o << " -d mult: non-negative floating point scale for frame time" << std::endl;
|
||||
@ -103,7 +104,7 @@ int handle_opts(int argc, char** argv, notcurses_options& opts, float* timescale
|
||||
*timescale = 1.0;
|
||||
*scalemode = NCScale::Scale;
|
||||
int c;
|
||||
while((c = getopt(argc, argv, "hl:d:s:")) != -1){
|
||||
while((c = getopt(argc, argv, "hl:d:s:k")) != -1){
|
||||
switch(c){
|
||||
case 'h':
|
||||
usage(std::cout, argv[0], EXIT_SUCCESS);
|
||||
@ -117,7 +118,10 @@ int handle_opts(int argc, char** argv, notcurses_options& opts, float* timescale
|
||||
*scalemode = NCScale::None;
|
||||
}
|
||||
break;
|
||||
case 'd':{
|
||||
case 'k':{
|
||||
opts.inhibit_alternate_screen = true;
|
||||
break;
|
||||
}case 'd':{
|
||||
std::stringstream ss;
|
||||
ss << optarg;
|
||||
float ts;
|
||||
|
Loading…
x
Reference in New Issue
Block a user