Skip to contentSkip to conversation

alsaucm: exit when user wants 'help' and 'version'

PATCH In review Lu Guanqun 2 participants 2 messages Aug 19, 2011

lore
Share & tools
lore

Lu Guanqun

author
#0 lore raw

PATCH 1/1 alsaucm: exit when user wants 'help' and 'version'

When user specifies option 'help' or 'version', the program exists immediately. This is more expected way than the current one.

---
 alsaucm/usecase.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
alsaucm/usecase.c +2 -2
index 1c94680..14a4be0 100644
@@ -395,10 +395,10 @@ int main(int argc, char *argv[])
 		switch (c) {
 		case 'h':
 			dump_help(context);
-			break;
+			my_exit(context, EXIT_SUCCESS);
 		case OPT_VERSION:
 			printf("%s: version " SND_UTIL_VERSION_STR "\n", command);
-			break;
+			my_exit(context, EXIT_SUCCESS);
 		case 'c':
 			if (context->card)
 				free(context->card);
Acked-by on v1 1/1
#1 lore raw
Quoted 16 lines · Lu Guanqun

When user specifies option 'help' or 'version', the program exists immediately. This is more expected way than the current one.

---
 alsaucm/usecase.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
alsaucm/usecase.c +0 -0
index 1c94680..14a4be0 100644
@@ -395,10 +395,10 @@ int main(int argc, char *argv[])
 		switch (c) {
 		case 'h':

alsaucm/usecase.c int main(int argc, char *argv[]) · line 404

Quoted 10 lines
alsaucm/usecase.c +2 -2
 			dump_help(context);
-			break;
+			my_exit(context, EXIT_SUCCESS);
 		case OPT_VERSION:
 			printf("%s: version " SND_UTIL_VERSION_STR "\n", command);
-			break;
+			my_exit(context, EXIT_SUCCESS);
 		case 'c':
 			if (context->card)
 				free(context->card);