Browse Source

Use command_new for startup and wdog commands

No need to have a special case just for these.
Ingo Albrecht 3 years ago
parent
commit
a7ce5853a3
2 changed files with 2 additions and 7 deletions
  1. 2 2
      clish/shell/shell_xml.c
  2. 0 5
      clish/view/view.c

+ 2 - 2
clish/shell/shell_xml.c

@@ -633,7 +633,7 @@ static int process_startup(clish_shell_t *shell, clish_xmlnode_t *element,
 	}
 
 	/* create a command with NULL help */
-	cmd = clish_view_new_command(v, "startup", NULL);
+	cmd = clish_command_new("startup", NULL);
 	clish_command__set_internal(cmd, BOOL_TRUE);
 
 	/* reference the next view */
@@ -1174,7 +1174,7 @@ static int process_wdog(clish_shell_t *shell,
 	}
 
 	/* Create a command with NULL help */
-	cmd = clish_view_new_command(v, "watchdog", NULL);
+	cmd = clish_command_new("watchdog", NULL);
 #ifdef LEGACY
 	// Legacy watchdog has lockless ACTION
 	clish_action__set_lock(clish_command__get_action(cmd), BOOL_FALSE);

+ 0 - 5
clish/view/view.c

@@ -98,11 +98,6 @@ clish_command_t *clish_view_new_command(clish_view_t * this,
 	clish_command_t *cmd = clish_command_new(name, help);
 	assert(cmd);
 
-	/* do not insert startup/wdog command */
-	if(!help) {
-		return cmd;
-	}
-
 	/* try to insert the command */
 	if(!clish_view_insert_command(this, cmd)) {
 		/* ignore duplicate */