mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	pw-dump: always output colors and add option to disable
-N disables colors now. Usually we want to preserve them in debug files and grep etc. Use less -R to get colors See #698
This commit is contained in:
		
							parent
							
								
									246f7bd77e
								
							
						
					
					
						commit
						90d8589fb9
					
				
					 1 changed files with 10 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -1355,7 +1355,8 @@ static void show_help(struct data *data, const char *name)
 | 
			
		|||
		"  -h, --help                            Show this help\n"
 | 
			
		||||
		"      --version                         Show version\n"
 | 
			
		||||
		"  -r, --remote                          Remote daemon name\n"
 | 
			
		||||
		"  -m, --monitor                         monitor changes\n",
 | 
			
		||||
		"  -m, --monitor                         monitor changes\n"
 | 
			
		||||
		"  -N, --no-colors                       disable color output\n",
 | 
			
		||||
		name);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1370,13 +1371,17 @@ int main(int argc, char *argv[])
 | 
			
		|||
		{ "version",	no_argument,		NULL, 'V' },
 | 
			
		||||
		{ "remote",	required_argument,	NULL, 'r' },
 | 
			
		||||
		{ "monitor",	no_argument,		NULL, 'm' },
 | 
			
		||||
		{ "no-colors",	no_argument,		NULL, 'N' },
 | 
			
		||||
		{ NULL, 0, NULL, 0}
 | 
			
		||||
	};
 | 
			
		||||
	int c;
 | 
			
		||||
 | 
			
		||||
	pw_init(&argc, &argv);
 | 
			
		||||
 | 
			
		||||
	while ((c = getopt_long(argc, argv, "hVr:m", long_options, NULL)) != -1) {
 | 
			
		||||
	data.out = stdout;
 | 
			
		||||
	colors = true;
 | 
			
		||||
 | 
			
		||||
	while ((c = getopt_long(argc, argv, "hVr:mN", long_options, NULL)) != -1) {
 | 
			
		||||
		switch (c) {
 | 
			
		||||
		case 'h' :
 | 
			
		||||
			show_help(&data, argv[0]);
 | 
			
		||||
| 
						 | 
				
			
			@ -1395,6 +1400,9 @@ int main(int argc, char *argv[])
 | 
			
		|||
		case 'm' :
 | 
			
		||||
			data.monitor = true;
 | 
			
		||||
			break;
 | 
			
		||||
		case 'N' :
 | 
			
		||||
			colors = false;
 | 
			
		||||
			break;
 | 
			
		||||
		default:
 | 
			
		||||
			show_help(&data, argv[0]);
 | 
			
		||||
			return -1;
 | 
			
		||||
| 
						 | 
				
			
			@ -1415,10 +1423,6 @@ int main(int argc, char *argv[])
 | 
			
		|||
	pw_loop_add_signal(l, SIGINT, do_quit, &data);
 | 
			
		||||
	pw_loop_add_signal(l, SIGTERM, do_quit, &data);
 | 
			
		||||
 | 
			
		||||
	data.out = stdout;
 | 
			
		||||
	if (isatty(fileno(data.out)))
 | 
			
		||||
		colors = true;
 | 
			
		||||
 | 
			
		||||
	data.context = pw_context_new(l, NULL, 0);
 | 
			
		||||
	if (data.context == NULL) {
 | 
			
		||||
		fprintf(stderr, "can't create context: %m\n");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue