Browse Source

ptype: ptype init can get method=code

Serj Kalichev 4 years ago
parent
commit
95e7ed3189
1 changed files with 4 additions and 2 deletions
  1. 4 2
      clish/ptype/ptype.c

+ 4 - 2
clish/ptype/ptype.c

@@ -40,8 +40,8 @@ static void clish_ptype_init(clish_ptype_t * this,
 		/* set the pattern for this type */
 		clish_ptype__set_pattern(this, pattern, method);
 	} else {
-		/* The method is regexp by default */
-		this->method = CLISH_PTYPE_METHOD_REGEXP;
+		// Only method="code" doesn't need a pattern
+		this->method = CLISH_PTYPE_METHOD_CODE;
 	}
 	
 	/* set the help text for this type */
@@ -64,6 +64,8 @@ static void clish_ptype_fini(clish_ptype_t * this)
 		case CLISH_PTYPE_METHOD_SELECT:
 			lub_argv_delete(this->u.select.items);
 			break;
+		case CLISH_PTYPE_METHOD_CODE:
+			break;
 		default:
 			break;
 		}