Add function for printing command usage
[oweals/u-boot_mod.git] / u-boot / common / cmd_custom.c
index 46dc7612340c3378ec430dbbd5fb1ae504824953..94b7cbd463681b4f8694f0fe9c55b9ffd7abde23 100644 (file)
@@ -77,15 +77,7 @@ int do_set_mac(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]){
 
        // allow only 2 arg (command name + mac), second argument length should be 17 (xx:xx:xx:xx:xx:xx)
        if(argc != 2 || strlen(argv[1]) != 17){
-#if defined(CFG_LONGHELP)
-               if(cmdtp->help != NULL){
-                       printf("Usage:\n%s %s\n", cmdtp->name, cmdtp->help);
-               } else {
-                       printf("Usage:\n%s %s\n", cmdtp->name, cmdtp->usage);
-               }
-#else
-               printf("Usage:\n%s %s\n", cmdtp->name, cmdtp->usage);
-#endif
+               print_cmd_help(cmdtp);
                return(1);
        }