]> Nishi Git Mirror - dataworks.git/commitdiff
add help
authornishi <nishi@d4a5a174-5a4a-5b4b-b672-37683c10d7d5>
Fri, 7 Jun 2024 09:42:36 +0000 (09:42 +0000)
committernishi <nishi@d4a5a174-5a4a-5b4b-b672-37683c10d7d5>
Fri, 7 Jun 2024 09:42:36 +0000 (09:42 +0000)
git-svn-id: file:///raid/svn-main/nishi-dataworks/trunk@177 d4a5a174-5a4a-5b4b-b672-37683c10d7d5

PKGBUILD
Server/hayes.c
Server/server.c
Server/tcpip.c
increment-PKGBUILD

index ccb2fbea7595ac54a89e0da91e318749f8509a5a..e33c89e9d9ab4c782c7e23d8d91e21db71fe72a5 100644 (file)
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,7 +5,7 @@ pkgver='0.1.0'
 pkgdesc='Database System'
 arch=('i686' 'x86_64')
 license=('BSD')
-pkgrel='6'
+pkgrel='7'
 makedepends=('byacc')
 source=('dataworks::svn+http://sw.nishi.boats/svn/nishi-dataworks/trunk#revision=')
 sha256sums=('SKIP')
index 200b127006c51331f95e7d03dfd617591ce21141..56ea8060f46cb4b418ea0a883112c5b75c44bb07 100644 (file)
@@ -145,6 +145,14 @@ int server_init(void) {
                                i++;
                                authfile = argv[i];
                                auth = true;
+                       } else if(option(argv[i], "h", "help")) {
+                               printf("\n");
+                               printf("Usage: %s [options] database\n", argv[0]);
+                               printf("You can use double-dash or slash for long-format flag, and single-dash or slash for short-foramt flag.\n");
+                               printf("Options:\n");
+                               printf("\t-p --port [comport]   Specify the modem port\n");
+                               printf("\t-l --login [path]     Specify the authentication file\n");
+                               exit(0);
                        } else {
                                fprintf(stderr, "Invalid option: %s\n", argv[i]);
                                return 1;
index 5249f38a5c5f219e5fbba1cae11d35941da1224a..d85f285b4f1d7e203129c68e2ec41f18e8a27755 100644 (file)
@@ -196,7 +196,8 @@ int main(int _argc, char** _argv) {
                                if(has_pass) {
                                        int shift = i;
                                        struct auth_entry** old_entries = entries;
-                                       for(i = 0; old_entries[i] != NULL; i++);
+                                       for(i = 0; old_entries[i] != NULL; i++)
+                                               ;
                                        entries = malloc(sizeof(*entries) * (i + 2));
                                        for(i = 0; old_entries[i] != NULL; i++) entries[i] = old_entries[i];
                                        free(old_entries);
index c11ef0b8bd90308f30494c527258f5175f6b49db..edfd78a5647288f2a4919f849bf846e635ac569a 100644 (file)
@@ -71,6 +71,14 @@ int server_init(void) {
                                i++;
                                authfile = argv[i];
                                auth = true;
+                       } else if(option(argv[i], "h", "help")) {
+                               printf("\n");
+                               printf("Usage: %s [options] database\n", argv[0]);
+                               printf("You can use double-dash or slash for long-format flag, and single-dash or slash for short-foramt flag.\n");
+                               printf("Options:\n");
+                               printf("\t-p --port [port]   Specify the port to be listened on\n");
+                               printf("\t-l --login [path]  Specify the authentication file\n");
+                               exit(0);
                        } else {
                                fprintf(stderr, "Invalid option: %s\n", argv[i]);
                                return 1;
index 7f8f011eb73d6043d2e6db9d2c101195ae2801f2..45a4fb75db864000d01701c0f7a51864bd4daabf 100644 (file)
@@ -1 +1 @@
-7
+8