I have defined a number of fabric tasks by subclassing Task (as described here: http://docs.fabfile.org/en/latest/usage/tasks.html#task-subclasses). I'd like to have a docstring in order to describe what each task subclass does which will be displayed on fab -l
just like when definining tasks with the @task
decorator. I tried putting the docstring in a number of places (after class
, after def run
) but it didn't work.
Is it possible to have a fab -l
visible description for tasks defined as subclasses of Task
?
For instance, here's a portion of my fabfile:
class BaseConfig(Task): def run(self): env.env = self.name env.user = 'serafeim' env.role = self.name puts("Using {0} configuration with user {1} at {2}".format(env.env, env.user, env.roledefs[env.env])) class UatConfig(BaseConfig): """ UAT settings """ name = "uat" uat_cfg_instance = UatConfig() class ProdConfig(BaseConfig): """ Prod settings """ name = "prod" prod_cfg_instance = ProdConfig()
When I run fab -l I only see
uat dev
without any description of what these do.