Skip to content

Commit

Permalink
Steps towards package descriptions.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tim committed Jan 24, 2012
1 parent 7d58797 commit dfae487
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/cargo/cargo.rs
Expand Up @@ -34,6 +34,7 @@ type package = {
uuid: str,
url: str,
method: str,
description: str,
ref: option::t<str>,
tags: [str]
};
Expand Down Expand Up @@ -269,12 +270,15 @@ fn load_one_source_package(&src: source, p: map::hashmap<str, json::json>) {
}
_ { }
}
// TODO: make this *actually* get the description from the .rc file.
let description = "This package's description.";
vec::grow(src.packages, 1u, {
// source: _source(src),
name: name,
uuid: uuid,
url: url,
method: method,
description: description,
ref: ref,
tags: tags
});
Expand Down Expand Up @@ -681,6 +685,9 @@ fn print_pkg(s: source, p: package) {
m = m + " [" + str::connect(p.tags, ", ") + "]";
}
info(m);
if p.description != "" {
print(" >> " + p.description)
}
}
fn cmd_list(c: cargo, argv: [str]) {
for_each_package(c, { |s, p|
Expand Down

0 comments on commit dfae487

Please sign in to comment.