Merge: src/doc/commands: clean commands hierarchy
[nit.git] / src / doc / commands / commands_base.nit
index 84ef656..bde3f8e 100644 (file)
@@ -69,6 +69,13 @@ abstract class DocCommand
        #
        # Warnings are generally used to distinguish empty list or mdoc from no data at all.
        fun init_command: CmdMessage do return new CmdSuccess
+
+       # Return a new filter for that command execution.
+       fun cmd_filter: ModelFilter do
+               var filter = self.filter
+               if filter == null then return new ModelFilter
+               return new ModelFilter.from(filter)
+       end
 end
 
 # Command message