Add NoProgressbar to pacman.conf options

This is useful for dumb terminals that do not support escape
sequences.

Signed-off-by: Ivy Foster <escondida@iff.ink>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Ivy Foster 2020-04-23 13:12:03 -05:00 committed by Allan McRae
parent 2439222375
commit 969e1ab996
4 changed files with 10 additions and 0 deletions

View file

@ -186,6 +186,10 @@ Options
*Color*:: *Color*::
Automatically enable colors only when pacman's output is on a tty. Automatically enable colors only when pacman's output is on a tty.
*NoProgressBar*::
Disables progress bars. This is useful for terminals which do
not support escape characters.
*TotalDownload*:: *TotalDownload*::
When downloading, display the amount downloaded, download rate, ETA, When downloading, display the amount downloaded, download rate, ETA,
and completed percentage of the entire download list rather and completed percentage of the entire download list rather

View file

@ -31,6 +31,7 @@ Architecture = auto
# Misc options # Misc options
#UseSyslog #UseSyslog
#Color #Color
#NoProgressBar
#TotalDownload #TotalDownload
CheckSpace CheckSpace
#VerbosePkgLists #VerbosePkgLists

View file

@ -583,6 +583,8 @@ static int _parse_options(const char *key, char *value,
config->color = isatty(fileno(stdout)) ? PM_COLOR_ON : PM_COLOR_OFF; config->color = isatty(fileno(stdout)) ? PM_COLOR_ON : PM_COLOR_OFF;
enable_colors(config->color); enable_colors(config->color);
} }
} else if(strcmp(key, "NoProgressBar") == 0) {
config->noprogressbar = 1;
} else if(strcmp(key, "DisableDownloadTimeout") == 0) { } else if(strcmp(key, "DisableDownloadTimeout") == 0) {
config->disable_dl_timeout = 1; config->disable_dl_timeout = 1;
} else { } else {

View file

@ -259,6 +259,7 @@ static void dump_config(void)
show_bool("VerbosePkgLists", config->verbosepkglists); show_bool("VerbosePkgLists", config->verbosepkglists);
show_bool("DisableDownloadTimeout", config->disable_dl_timeout); show_bool("DisableDownloadTimeout", config->disable_dl_timeout);
show_bool("ILoveCandy", config->chomp); show_bool("ILoveCandy", config->chomp);
show_bool("NoProgressBar", config->noprogressbar);
show_cleanmethod("CleanMethod", config->cleanmethod); show_cleanmethod("CleanMethod", config->cleanmethod);
@ -368,6 +369,8 @@ static int list_directives(void)
show_bool("VerbosePkgLists", config->verbosepkglists); show_bool("VerbosePkgLists", config->verbosepkglists);
} else if(strcasecmp(i->data, "DisableDownloadTimeout") == 0) { } else if(strcasecmp(i->data, "DisableDownloadTimeout") == 0) {
show_bool("DisableDownloadTimeout", config->disable_dl_timeout); show_bool("DisableDownloadTimeout", config->disable_dl_timeout);
} else if(strcasecmp(i->data, "NoProgressBar") == 0) {
show_bool("NoProgressBar", config->noprogressbar);
} else if(strcasecmp(i->data, "CleanMethod") == 0) { } else if(strcasecmp(i->data, "CleanMethod") == 0) {
show_cleanmethod("CleanMethod", config->cleanmethod); show_cleanmethod("CleanMethod", config->cleanmethod);