Commits

Alessio Caiazza committed a399e04

help should work also when no device are selected

Comments (0)

Files changed (1)

                 elem = split(&argv, cmd, " ");
                 
 
-                
+                if (strncmp(argv[0], "help", 4) == 0) {
+                        printf("Available commands: \n");
+                        printf("[discover|select|nodev|ip|vlan|port|sys] \n");
+                }
+
                 if (strncmp(argv[0], "discover", 8) == 0) {
                         n = gs105e_discover();
                         printf("Discovered \033[92m%i\033[0m devices\n", n);
                 if (strncmp(argv[0], "sys", 3) == 0) {
                         shell_sys(argv, elem);
                 }
-                
-                if (strncmp(argv[0], "help", 4) == 0) {
-                        printf("Available commands: \n");
-                        printf("[discover|select|nodev|ip|vlan|port|sys] \n");
-                }
-
-                
-                
         }
 }