aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormichael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2009-01-16 05:44:14 +0000
committermichael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2009-01-16 05:44:14 +0000
commitacb916cb77a9687d1166cc72c1cfa1ae5b76159c (patch)
treeeadc5eef4e74e99cf322d5271d776ab74470a5d4
parentee577129bcb8881a58afe9d8dc87f1aed6133417 (diff)
downloadlcd4linux-acb916cb77a9687d1166cc72c1cfa1ae5b76159c.tar.gz
option parsing modified
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@971 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
-rw-r--r--lcd4linux.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/lcd4linux.c b/lcd4linux.c
index 1fde9f7..18fc7ce 100644
--- a/lcd4linux.c
+++ b/lcd4linux.c
@@ -81,7 +81,7 @@ static void usage(void)
printf("\n");
printf("options:\n");
printf(" -h help\n");
- printf(" -l list available display drivers\n");
+ printf(" -l list available display drivers and plugins\n");
printf(" -c <key>=<value> overwrite entries from the config-file\n");
printf(" -i enter interactive mode (after display initialisation)\n");
printf(" -ii enter interactive mode (before display initialisation)\n");
@@ -206,6 +206,7 @@ int main(int argc, char *argv[])
int c;
int quiet = 0;
int interactive = 0;
+ int list_mode = 0;
int pid;
/* save arguments for restart */
@@ -244,14 +245,8 @@ int main(int argc, char *argv[])
interactive++;
break;
case 'l':
- printf("%s\n", release);
- printf("%s\n", copyright);
- printf("\n");
- drv_list();
- printf("\n");
- plugin_list();
- printf("\n");
- exit(0);
+ list_mode++;
+ break;
case 'o':
output = optarg;
break;
@@ -279,7 +274,18 @@ int main(int argc, char *argv[])
running_foreground = 1;
}
- info("Version " VERSION "-" SVN_VERSION " starting");
+ if (list_mode > 0) {
+ printf("%s\n", release);
+ printf("%s\n", copyright);
+ printf("\n");
+ drv_list();
+ printf("\n");
+ plugin_list();
+ printf("\n");
+ exit(0);
+ }
+
+ info("%s starting", release);
if (!running_foreground && (my_argv[0] == NULL || my_argv[0][0] != '/')) {
info("invoked without full path; restart may not work!");
}