From b727cf94f2ea5d7f66b22e623288f78a35596949 Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Wed, 20 Apr 2011 20:18:58 -0400 Subject: [PATCH] task/setting/attribute descriptions --- util/collection/Attributes.scala | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/util/collection/Attributes.scala b/util/collection/Attributes.scala index 4697c63b9..4c3a16873 100644 --- a/util/collection/Attributes.scala +++ b/util/collection/Attributes.scala @@ -6,15 +6,23 @@ package sbt import Types._ // T must be invariant to work properly. -// Because it is sealed and the only instances go through make, +// Because it is sealed and the only instances go through AttributeKey.apply, // a single AttributeKey instance cannot conform to AttributeKey[T] for different Ts sealed trait AttributeKey[T] { def label: String + def description: Option[String] override final def toString = label } object AttributeKey { - def apply[T](name: String): AttributeKey[T] = new AttributeKey[T] { def label = name } + def apply[T](name: String): AttributeKey[T] = new AttributeKey[T] { + def label = name + def description = None + } + def apply[T](name: String, description0: String): AttributeKey[T] = new AttributeKey[T] { + def label = name + def description = Some(description0) + } } trait AttributeMap