pnoltes commented on code in PR #476:
URL: https://github.com/apache/celix/pull/476#discussion_r1117934819


##########
libs/framework/src/celix_launcher.c:
##########
@@ -62,107 +76,93 @@ int celixLauncher_launchAndWaitForShutdown(int argc, char 
*argv[], celix_propert
                opt = argv[1];
        }
 
-       char *config_file = NULL;
+       char* configFile = NULL;
        bool showProps = false;
     bool showEmbeddedBundles = false;
+    bool createCache = false;
        for (int i = 1; i < argc; ++i) {
                opt = argv[i];
                // Check whether the user wants some help...
                if (strncmp("-?", opt, strlen("-?")) == 0 || strncmp("-h", opt, 
strlen("-h")) == 0 || strncmp("--help", opt, strlen("--help")) == 0) {
-                       show_usage(argv[0]);
-                       celix_properties_destroy(packedConfig);
+            celixLauncher_printUsage(argv[0]);
+                       celix_properties_destroy(embeddedConfig);
                        return 0;
                } else if (strncmp("-p", opt, strlen("-p")) == 0 || 
strncmp("--props", opt, strlen("--props")) == 0) {
             showProps = true;
+        } else if (strncmp("-c", opt, strlen("-c")) == 0 || 
strncmp("--create-bundle-cache", opt, strlen("--create-bundle-cache")) == 0) {
+            createCache = true;
         } else if (strncmp("--embedded_bundles", opt, 
strlen("--embedded_bundles")) == 0) {
             showEmbeddedBundles = true;
                } else {
-                       config_file = opt;
+            configFile = opt;
                }
        }
 
-       if (config_file == NULL) {
-               config_file = DEFAULT_CONFIG_FILE;
+       if (configFile == NULL) {
+        configFile = DEFAULT_CONFIG_FILE;
        }
 
-       if (packedConfig == NULL) {
-               packedConfig = celix_properties_create();
+       if (embeddedConfig == NULL) {
+        embeddedConfig = celix_properties_create();
        }
 
        if (showProps) {
-               show_properties(packedConfig, config_file);
-               celix_properties_destroy(packedConfig);
+        celixLauncher_printProperties(embeddedConfig, configFile);
+               celix_properties_destroy(embeddedConfig);
                return 0;
        }
 
+    if (createCache) {
+        return celixLauncher_createBundleCache(embeddedConfig, configFile);
+    }
+
     if (showEmbeddedBundles) {
-        printEmbeddedBundles();
-        celix_properties_destroy(packedConfig);
+        celixLauncher_printEmbeddedBundles();
+        celix_properties_destroy(embeddedConfig);
         return 0;
     }
 
        struct sigaction sigact;
        memset(&sigact, 0, sizeof(sigact));
-       sigact.sa_handler = shutdown_framework;
+       sigact.sa_handler = celixLauncher_shutdownFramework;

Review Comment:
   Good to known. Maybe the same setup used in shell_tui.c (to break the lock 
on pollfds) can be used, but indeed something for different PR.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@celix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to