Use pager for more commands
This commit is contained in:
		
							parent
							
								
									9481f77693
								
							
						
					
					
						commit
						43579c9799
					
				
					 2 changed files with 8 additions and 1 deletions
				
			
		|  | @ -977,6 +977,9 @@ static void opQuery(Globals & globals, Strings opFlags, Strings opArgs) | |||
|         return; | ||||
|     } | ||||
| 
 | ||||
|     bool tty = isatty(STDOUT_FILENO); | ||||
|     RunPager pager; | ||||
| 
 | ||||
|     Table table; | ||||
|     std::ostringstream dummy; | ||||
|     XMLWriter xml(true, *(xmlOutput ? &cout : &dummy)); | ||||
|  | @ -1049,7 +1052,7 @@ static void opQuery(Globals & globals, Strings opFlags, Strings opArgs) | |||
|                     } | ||||
|                 } else { | ||||
|                     string column = (string) "" + ch + " " + version; | ||||
|                     if (diff == cvGreater && isatty(STDOUT_FILENO)) | ||||
|                     if (diff == cvGreater && tty) | ||||
|                         column = ANSI_RED + column + ANSI_NORMAL; | ||||
|                     columns.push_back(column); | ||||
|                 } | ||||
|  | @ -1240,6 +1243,8 @@ static void opListGenerations(Globals & globals, Strings opFlags, Strings opArgs | |||
|     int curGen; | ||||
|     Generations gens = findGenerations(globals.profile, curGen); | ||||
| 
 | ||||
|     RunPager pager; | ||||
| 
 | ||||
|     for (Generations::iterator i = gens.begin(); i != gens.end(); ++i) { | ||||
|         tm t; | ||||
|         if (!localtime_r(&i->creationTime, &t)) throw Error("cannot convert time"); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue