alsactl - Set -F option as default

Set -F option as default for restore.  There are still too many systems
that are too lazy to set -F option...

Added the new -P option to back to the old behavior.
This commit is contained in:
Takashi Iwai 2007-11-14 11:54:38 +01:00
parent 6f05fd4db2
commit e5b2ab2a9f
2 changed files with 13 additions and 2 deletions

View file

@ -41,7 +41,12 @@ Select the configuration file to use. The default is /etc/asound.state or
.TP .TP
\fI\-F, \-\-force\fP \fI\-F, \-\-force\fP
Used with restore command. Try to restore the matching control elements Used with restore command. Try to restore the matching control elements
as much as possible. as much as possible. This option is set as default now.
.TP
\fI\-P, \-\-pedantic\fP
Used with restore command. Don't restore mismatching control elements.
This option was the old default behavior.
.TP .TP
\fI\-d, \-\-debug\fP \fI\-d, \-\-debug\fP

View file

@ -34,7 +34,7 @@
#define SYS_ASOUNDNAMES "/etc/asound.names" #define SYS_ASOUNDNAMES "/etc/asound.names"
int debugflag = 0; int debugflag = 0;
int force_restore = 0; int force_restore = 1;
char *command; char *command;
static void help(void) static void help(void)
@ -44,6 +44,8 @@ static void help(void)
printf(" -h,--help this help\n"); printf(" -h,--help this help\n");
printf(" -f,--file # configuration file (default " SYS_ASOUNDRC " or " SYS_ASOUNDNAMES ")\n"); printf(" -f,--file # configuration file (default " SYS_ASOUNDRC " or " SYS_ASOUNDNAMES ")\n");
printf(" -F,--force try to restore the matching controls as much as possible\n"); printf(" -F,--force try to restore the matching controls as much as possible\n");
printf(" (default mode)\n");
printf(" -P,--pedantic don't restore mismatching controls (old default)\n");
printf(" -d,--debug debug mode\n"); printf(" -d,--debug debug mode\n");
printf(" -v,--version print version of this program\n"); printf(" -v,--version print version of this program\n");
printf("\nAvailable commands:\n"); printf("\nAvailable commands:\n");
@ -62,6 +64,7 @@ int main(int argc, char *argv[])
{"help", 0, NULL, 'h'}, {"help", 0, NULL, 'h'},
{"file", 1, NULL, 'f'}, {"file", 1, NULL, 'f'},
{"force", 0, NULL, 'F'}, {"force", 0, NULL, 'F'},
{"pedantic", 0, NULL, 'P'},
{"debug", 0, NULL, 'd'}, {"debug", 0, NULL, 'd'},
{"version", 0, NULL, 'v'}, {"version", 0, NULL, 'v'},
{NULL, 0, NULL, 0}, {NULL, 0, NULL, 0},
@ -85,6 +88,9 @@ int main(int argc, char *argv[])
case 'F': case 'F':
force_restore = 1; force_restore = 1;
break; break;
case 'P':
force_restore = 0;
break;
case 'd': case 'd':
debugflag = 1; debugflag = 1;
break; break;