summary refs log tree commit diff
path: root/src/libstd/getopts.rs
AgeCommit message (Collapse)AuthorLines
2013-03-29librustc: Remove `fail_unless!`Patrick Walton-80/+80
2013-03-28Removing unused importsAlex Crichton-1/+1
2013-03-26Switched over a bunch of splitting funktions to non-allocating iteratorsMarvin Löbel-6/+7
2013-03-26pre-rebase commitMarvin Löbel-2/+17
2013-03-22std: replace uses of old deriving attribute with new oneAndrew Paseltiner-9/+9
2013-03-21back-renamed slice_DBG_BRWD, slice_V_DBG_BRWD -> slice, slice_DBG_UNIQ -> ↵Marvin Löbel-2/+2
slice_unique
2013-03-21renamed str::view -> slice_DBG_BRWDMarvin Löbel-2/+2
renamed str::slice -> slice_DBG_UNIQ changed vec slice method -> to_owned() renamed vec view method -> slice_V_DBG_BRWD
2013-03-13auto merge of #5293 : brson/rust/logging, r=brsonbors-1/+1
r? @graydon This removes `log` from the language. Because we can't quite implement it as a syntax extension (probably need globals at the least) it simply renames the keyword to `__log` and hides it behind macros. After this the only way to log is with `debug!`, `info!`, etc. I figure that if there is demand for `log!` we can add it back later. I am not sure that we ever agreed on this course of action, though I *think* there is consensus that `log` shouldn't be a statement.
2013-03-12auto merge of #5329 : wanderview/rust/std-getopts-opts_present, r=graydonbors-4/+5
Currently the opts_present() function only checks to see if the option is configured in the match, but doesn't actually check to see if the option value has been set. This means that opt_present('h') may return false while opts_present([~'h']) returns true. Add a test case to catch this condition and fix opts_present() to check the value before returning true. Note, there is another API difference between these two functions that this does not address. Currently if you pass a non-configured option to opt_present() the program will fail!(), but opts_present() simply returns false. If it is acceptable to standardize on the fail!() then opts_present() should probably be implemented in terms of the opt_present() function.
2013-03-11Remove uses of logBrian Anderson-1/+1
2013-03-11Fix std::getopts::opts_present() to check value.Ben Kelly-4/+5
Currently the opts_present() function only checks to see if the option is configured in the match, but doesn't actually check to see if the option value has been set. This means that opt_present('h') may return false while opts_present([~'h']) returns true. Add a test case to catch this condition and fix opts_present() to check the value before returning true. Note, there is another API difference between these two functions that this does not address. Currently if you pass a non-configured option to opt_present() the program will fail!(), but opts_present() simply returns false. If it is acceptable to standardize on the fail!() then opts_present() should probably be implemented in terms of the opt_present() function.
2013-03-10Correct copyright year to be 2012-2013.Ben Kelly-1/+1
Previous year range of 2011-2013 was based on file creation date. The check_license python script, however, only accepts copyrights starting in 2012 or later.
2013-03-10Fix formatting and errors in std::getopts example.Ben Kelly-5/+8
There were three issues effecting the example in the getopts rustdoc: 1. The blockquote was incorrectly formatted. Fixed by switching to using an explicit markdown code section with ```. 2. The `fail fail_str(f)` would not compile. Fixed by using `fail!()` instead of `fail`. 3. The line `matches.free[0]` produced a compile error about moving from an immutable vector. Fix by using `copy`.
2013-03-07librustc: Convert all uses of `assert` over to `fail_unless!`Patrick Walton-85/+85
2013-03-04Adding missing imports for tests, and gate off othersAlex Crichton-1/+0
2013-03-04Remove unused imports throughout src/Alex Crichton-1/+0
2013-02-28Fix implicit leaks of imports throughout librariesAlex Crichton-1/+1
Also touch up use of 'pub' and move some tests around so the tested functions don't have to be 'pub'
2013-02-15libstd: Get rid of `move`.Luqman Aden-4/+4
2013-02-13Remove die!, raplace invocations with fail! Issue #4524 pt 3Nick Desaulniers-48/+48
2013-02-13RIMOV core::vecBen Striegel-2/+2
Also remove as many uses as possible of vec::cast_to_mut and cast_from_mut
2013-02-08Remove trailing whitespaceMatthew McPherrin-5/+5
2013-02-08Merge branch 'master' of https://github.com/mozilla/rustMatthew McPherrin-1/+0
2013-02-07Make ~fn non-copyable, make &fn copyable, split barefn/closure types,Niko Matsakis-1/+0
correct handling of moves for struct-record update. Part of #3678. Fixes #2828, #3904, #4719.
2013-02-06Fix sample program to compile in modern rustMatthew McPherrin-42/+44
2013-01-31Replace most invocations of fail keyword with die! macroNick Desaulniers-49/+49
2013-01-29De-capitalize "note" to get rid of spurious tidy warningsTim Chevalier-1/+1
2013-01-29libstd: De-export libstd. rs=deexportPatrick Walton-53/+52
2013-01-24replace ConstVector trait with the Container traitDaniel Micay-3/+3
2013-01-23libsyntax: Remove `fn() unsafe { ... }`. r=graydonPatrick Walton-108/+110
2013-01-23core: Rename to_mut and from_mut to cast_to_mut and cast_from_mutTrinick-2/+2
2013-01-08librustc: Make unqualified identifier searches terminate at the nearest ↵Patrick Walton-6/+11
module scope. r=tjc
2013-01-08Revert "librustc: Make unqualified identifier searches terminate at the ↵Patrick Walton-11/+6
nearest module scope. r=tjc" This reverts commit a8d37af2473da79be704c9ce2374f278c47177b6.
2013-01-08librustc: Make unqualified identifier searches terminate at the nearest ↵Patrick Walton-6/+11
module scope. r=tjc
2012-12-27libstd: Fix a bunch of resolve errors in tests. rs=firePatrick Walton-1/+4
2012-12-27librustc: Terminate name searches at the nearest module scope for paths that ↵Patrick Walton-0/+7
contain at least two components. r=graydon
2012-12-13Replace some Eq impls with deriving_eqBrian Anderson-115/+10
2012-12-13std: Convert records to structs in getoptsBrian Anderson-33/+42
2012-12-07Make short flags with a single-char arg work in getoptsTim Chevalier-34/+37
This looks like a big patch, but it's mostly just modernization. The real change is in the fn called `getopts`, the line if arg_follows && j < curlen { Minor bugfix, no review. Closes #2822
2012-12-03Update license, add license boilerplate to most files. Remainder will follow.Graydon Hoare-0/+10
2012-11-28Merge remote-tracking branch 'brson/companion' into incomingBrian Anderson-139/+3
Conflicts: src/compiletest/compiletest.rs src/libcargo/cargo.rs src/libcore/core.rs src/librustc/rustc.rs src/librustdoc/rustdoc.rc
2012-11-28Register snapshotsBrian Anderson-139/+3
2012-11-24[libstd] getopts, now with fewer copiesTim Chevalier-37/+37
Change the opt_ functions in getopts to take a reference to a Matches, instead of taking a Matches by-value, as suggested in
2012-11-19rustc: Implement explicit self for Eq and Ord. r=graydonPatrick Walton-0/+138
2012-11-18WhitespaceBrian Anderson-1/+1
2012-11-17Added support for options that take no arguments and may be repeated.Jesse Jones-0/+75
Closes #3568.
2012-10-17Add a module to getopts to support verbose option definitionKevin Cantu-3/+409
This is built on top of the existing functionality, but adds a `groups` module which defines functions allowing the user to specify whole short/long/description groups at once and provides a usage message.
2012-10-04Remove by-copy mode from std, mostlyTim Chevalier-4/+3
One instance remains in net_tcp due to a foreign fn. Lots of instances remain in serialization.rs, but IIRC that is being removed. I had to do unholy things to task-perf-word-count-generic to get it to compile after demoding pipes. I may well have messed up its performance, but it passes.
2012-10-03Remove crudTim Chevalier-1/+0
2012-10-03Remove uses of + mode from libstdTim Chevalier-12/+13
More or less the same as my analogous commit for libcore. Had to remove the forbid(deprecated_modes) pragma from some files -- will restore it after the snapshot.
2012-10-03De-export std::{json, getopts}. Part of #3583.Graydon Hoare-36/+18