Skip to content

Commit dfae487

Browse files
author
tim
committed
Steps towards package descriptions.
I added a description field for `package` objects (it's read from a literal string for now) and `print_pkg` now prints descriptions if they're there.
1 parent 7d58797 commit dfae487

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/cargo/cargo.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ type package = {
3434
uuid: str,
3535
url: str,
3636
method: str,
37+
description: str,
3738
ref: option::t<str>,
3839
tags: [str]
3940
};
@@ -269,12 +270,15 @@ fn load_one_source_package(&src: source, p: map::hashmap<str, json::json>) {
269270
}
270271
_ { }
271272
}
273+
// TODO: make this *actually* get the description from the .rc file.
274+
let description = "This package's description.";
272275
vec::grow(src.packages, 1u, {
273276
// source: _source(src),
274277
name: name,
275278
uuid: uuid,
276279
url: url,
277280
method: method,
281+
description: description,
278282
ref: ref,
279283
tags: tags
280284
});
@@ -681,6 +685,9 @@ fn print_pkg(s: source, p: package) {
681685
m = m + " [" + str::connect(p.tags, ", ") + "]";
682686
}
683687
info(m);
688+
if p.description != "" {
689+
print(" >> " + p.description)
690+
}
684691
}
685692
fn cmd_list(c: cargo, argv: [str]) {
686693
for_each_package(c, { |s, p|

0 commit comments

Comments
 (0)