Skip to content

Commit e28ed30

Browse files
committed
---
yaml --- r: 36349 b: refs/heads/try2 c: d701fcd h: refs/heads/master i: 36347: dd542ec v: v3
1 parent 8d11f89 commit e28ed30

File tree

3 files changed

+14
-76
lines changed

3 files changed

+14
-76
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 340955b3a55c0707e72d64b2ce4cdcf21529fafb
8+
refs/heads/try2: d701fcd8a52fdd1cf85516c546edcc8de9b5d400
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try2/doc/README

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
The markdown docs are only generated by make when node is installed (use
2+
`make doc`). If you don't have node installed you can generate them yourself.
3+
Unfortunately there's no real standard for markdown and all the tools work
4+
differently. pandoc is one that seems to work well.
5+
6+
To generate an html version of a doc do something like:
7+
pandoc --from=markdown --to=html --number-sections -o build/doc/rust.html doc/rust.md && git web--browse build/doc/rust.html
8+
9+
The syntax for pandoc flavored markdown can be found at:
10+
http://johnmacfarlane.net/pandoc/README.html#pandocs-markdown
11+
12+
A nice quick reference (for non-pandoc markdown) is at:
13+
http://kramdown.rubyforge.org/quickref.html

branches/try2/src/libstd/getopts.rs

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,6 @@ pub fn optflag(name: &str) -> Opt {
145145
return {name: mkname(name), hasarg: No, occur: Optional};
146146
}
147147

148-
/// Create an option that is optional and does not take an argument
149-
pub fn optflagmulti(name: &str) -> Opt {
150-
return {name: mkname(name), hasarg: No, occur: Multi};
151-
}
152-
153148
/// Create an option that is optional and takes an optional argument
154149
pub fn optflagopt(name: &str) -> Opt {
155150
return {name: mkname(name), hasarg: Maybe, occur: Optional};
@@ -422,11 +417,6 @@ pub fn opt_present(mm: Matches, nm: &str) -> bool {
422417
return vec::len::<Optval>(opt_vals(mm, nm)) > 0u;
423418
}
424419

425-
/// Returns the number of times an option was matched
426-
pub fn opt_count(mm: Matches, nm: &str) -> uint {
427-
return vec::len::<Optval>(opt_vals(mm, nm));
428-
}
429-
430420
/// Returns true if any of several options were matched
431421
pub fn opts_present(mm: Matches, names: &[~str]) -> bool {
432422
for vec::each(names) |nm| {
@@ -1013,71 +1003,6 @@ mod tests {
10131003
}
10141004
}
10151005

1016-
// Tests for optflagmulti
1017-
#[test]
1018-
fn test_optflagmulti_short1() {
1019-
let args = ~[~"-v"];
1020-
let opts = ~[optflagmulti(~"v")];
1021-
let rs = getopts(args, opts);
1022-
match rs {
1023-
Ok(copy m) => {
1024-
assert (opt_count(m, ~"v") == 1);
1025-
}
1026-
_ => fail
1027-
}
1028-
}
1029-
1030-
#[test]
1031-
fn test_optflagmulti_short2a() {
1032-
let args = ~[~"-v", ~"-v"];
1033-
let opts = ~[optflagmulti(~"v")];
1034-
let rs = getopts(args, opts);
1035-
match rs {
1036-
Ok(copy m) => {
1037-
assert (opt_count(m, ~"v") == 2);
1038-
}
1039-
_ => fail
1040-
}
1041-
}
1042-
1043-
#[test]
1044-
fn test_optflagmulti_short2b() {
1045-
let args = ~[~"-vv"];
1046-
let opts = ~[optflagmulti(~"v")];
1047-
let rs = getopts(args, opts);
1048-
match rs {
1049-
Ok(copy m) => {
1050-
assert (opt_count(m, ~"v") == 2);
1051-
}
1052-
_ => fail
1053-
}
1054-
}
1055-
1056-
#[test]
1057-
fn test_optflagmulti_long1() {
1058-
let args = ~[~"--verbose"];
1059-
let opts = ~[optflagmulti(~"verbose")];
1060-
let rs = getopts(args, opts);
1061-
match rs {
1062-
Ok(copy m) => {
1063-
assert (opt_count(m, ~"verbose") == 1);
1064-
}
1065-
_ => fail
1066-
}
1067-
}
1068-
1069-
#[test]
1070-
fn test_optflagmulti_long2() {
1071-
let args = ~[~"--verbose", ~"--verbose"];
1072-
let opts = ~[optflagmulti(~"verbose")];
1073-
let rs = getopts(args, opts);
1074-
match rs {
1075-
Ok(copy m) => {
1076-
assert (opt_count(m, ~"verbose") == 2);
1077-
}
1078-
_ => fail
1079-
}
1080-
}
10811006

10821007
// Tests for optmulti
10831008
#[test]

0 commit comments

Comments
 (0)