--- /dev/null
+#import <ObjFW/ObjFW.h>
+
+@class JubCLIUI;
+
+@protocol JubCLICommand
+@property (readonly) OFString *command;
+@property (readonly) OFString *params;
+@property (readonly) OFString *help;
+
+- initWithCLIUI: (JubCLIUI*)ui;
+- (void)callWithParameters: (OFArray*)parameters;
+@end
+
+#define BEGINCLICOMMAND(name, com, paramsString, helpString) \
+ @interface name: OFObject<JubCLICommand> \
+ { \
+ JubCLIUI *_ui; \
+ } \
+ @end \
+ @implementation name \
+ - initWithCLIUI: (JubCLIUI*)ui \
+ { \
+ self = [super init]; \
+ _ui = [ui retain]; \
+ return self; \
+ } \
+ - (void)dealloc \
+ { \
+ [_ui release]; \
+ [super dealloc]; \
+ } \
+ - (OFString*)command { return com; } \
+ - (OFString*)params { return paramsString; } \
+ - (OFString*)help { return helpString; } \
+ - (void)callWithParameters: (OFArray*)parameters
+
+#define ENDCLICOMMAND @end