Kevin K
82b0c5c3d7
docs(macros.rs): fixes doc tests
2015-05-01 14:50:28 -04:00
Kevin K
22aef2ab45
style(clap): rustfmt run
2015-05-01 14:44:20 -04:00
Kevin K
08635e6b5e
style(clap): makes changes to follow Rust style guide
2015-05-01 14:43:26 -04:00
Kevin K
1f1fc04e1e
docs(arg.rs): improves docs and fix typos
2015-05-01 10:19:19 -04:00
Kevin K
86d92c9fdb
fix(MultipleValues): stops evaluating values if the max or exact number of values was reached
2015-04-30 22:17:10 -04:00
Kevin K
82d03638d3
docs(lib.rs): fix doc tests
2015-04-30 20:43:22 -04:00
Kevin K
0d123a0d86
docs(clap): update docs
2015-04-30 20:13:01 -04:00
Kevin K
53f6b8c9d8
feat(MultipleValues): add support for minimum and maximum number of values
2015-04-30 19:32:51 -04:00
Kevin K
ae09f05e92
feat(MultipleValues): adds support limited number and named values
2015-04-30 18:02:19 -04:00
Kevin K
6669f0a968
feat(MultipleValues): implement shorthand for options with multiple values
2015-04-30 15:11:12 -04:00
Kevin K
d77048efb1
feat(usage): implement smart usage strings on errors
...
Closes #88
2015-04-30 12:12:44 -04:00
Kevin K
0cc2f69839
feat(arg): allow other types besides Vec for multiple value settings
...
Breaking Change
Instead of requiring a Vec<&str> for various Arg::*_all() and
Arg::possible_values() methods this
commit now requires a generic IntoIterator<Item=AsRef<str>> which allows
things such as constant arrays. This change requires that any
Arg::*_all() methods be changed from vec!["val", "val"] -> let vals =
["val", "val"]; some_arg.possible_values(&vals) (or vals.iter()).
Closes #87
2015-04-29 17:52:13 -04:00
Kevin K
1c92ed0e72
chore(docs): change makefile -> travis auto cargo doc and upload
2015-04-28 23:18:08 -04:00
Kevin K
ad4e545107
fix(from_usage): removes bug where usage strings have no help text
...
Creating arguments from usage strings with no help text previously
dropped the final character i.e. --flags -> --flag
This commit fixes that issue by testing if we are at the end of the
string
Closes #83
2015-04-28 22:11:20 -04:00
Kevin K
60c1b307ac
docs(groups): adds documentation for ArgGroups
2015-04-27 22:52:50 -04:00
Kevin K
4bb4c3cc07
fix(RequiredArgs): required by default args should no longer be required when their exclusions are present
2015-04-27 00:53:12 -04:00
Kevin K
09eb4d9893
feat(ArgGroups): add ability to create arg groups
2015-04-27 00:53:12 -04:00
Kevin K
cfffb45aa4
style(clap): clean commented out code
2015-04-25 23:55:42 -04:00
Kevin K
17e3f141aa
refactor(args.rs): deprecate mutually_excludes* for conflicts_with* methods
2015-04-25 22:59:02 -04:00
Kevin K
1e25abfc36
fix(help): change long help --long=long -> --long <long>
2015-04-25 22:19:09 -04:00
Kevin K
fd61615d1a
perf(matchedargs): remove unused vars and String->&str
...
This commit increases the performance a bit by using string slices
instead of owned strings. The trade off is that code previously written
to handle all the argument parsing in a speratate function and return
only the ArgMatches must be re-written to add a lifetime specifier:
Old code 'fn handle_args<'a>() -> ArgMatches<'a>' needs another lifetime
specifier added, so now 'fn handle_args<'a, 'b>() -> ArgMatches<'a, 'b>'
BREAKING CHANGE
2015-04-25 11:12:07 -04:00
Kevin K
b76129e9b7
fix(from_usage): fix bug causing args to not be required
2015-04-22 16:08:34 -04:00
Kevin K
d7c724dc65
tests(usage): fix typo in test variable names
2015-04-22 11:23:15 -04:00
Kevin K
dc59b12eb0
refactor(app.rs): rename more_help()->after_help()
2015-04-20 19:55:09 -04:00
Kevin K
65cc259e45
feat(apps): add ability to display additional help info after auto-gen'ed help msg
2015-04-19 20:19:21 -04:00
Kevin K
bb9d0c377e
tests(from_usage): add tests for usage strings with tabs
2015-04-19 14:31:56 -04:00
Kevin K
4fd44181d5
fix(from_usage): tabs and spaces should be treated equally
2015-04-19 14:27:05 -04:00
Kevin K
c630969aa3
feat(macros.rs): add macro to get version from Cargo.toml
2015-04-19 14:22:03 -04:00
Kevin K
86e4075eb1
fix(macros.rs): fix use statements for trait impls
2015-04-18 22:23:18 -04:00
Kevin K
e7f77353b9
refactor(macros.rs): improve trait implmentation readability
2015-04-18 22:20:43 -04:00
Kevin K
31b476ca99
refactor(arg.rs): remove deprecation warnings for stable rustc
2015-04-18 13:37:01 -04:00
Kevin K
14d810d072
refactor(clap): restructure matched args for performance and deduplication
2015-04-17 17:11:10 -04:00
Kevin K
2c499f8015
feat(macros): add ability to create enums pub or priv with derives
...
Err type of FromStr trait changed from &'a str->String in order
to allow showing valid values on failed parse
Breaking Change
2015-04-17 11:17:19 -04:00
Kevin K
fb672aff56
feat(macros): add macro to create custom enums to use as types
2015-04-16 14:21:32 -04:00
Kevin K
1a192521b6
docs(clap): fix typo core->std
2015-04-16 12:53:05 -04:00
Kevin K
d126cfdc69
chore(clap): rebuild docs with nightly rustdoc
2015-04-14 16:18:07 -04:00
Kevin K
4057d34d93
docs(macros): add documentation covering value_t! and value_t_or_exit
2015-04-14 15:16:16 -04:00
Kevin K
0b87251fc0
feat(macros): add ability to get mutliple typed values or exit
2015-04-14 14:33:37 -04:00
Kevin K
e243fe38dd
feat(macros): add ability to get a typed multiple values
2015-04-14 14:07:33 -04:00
Kevin K
4b7cd3ea49
feat(macros): add convenience macro to get a typed value or exit
2015-04-14 13:37:35 -04:00
Kevin K
8752700fbb
feat(macros): add convenience macro to get a typed value
2015-04-14 12:14:17 -04:00
Kevin K
b67f2e537e
docs(clap): fix failing doc tests
2015-04-13 22:26:41 -04:00
Kevin K
b389743672
docs(clap): improve examples and documentation as well as include new from_usage() features
2015-04-13 22:18:50 -04:00
Kevin K
91d2904599
fix(from_usage): trim all whitespace before parsing
2015-04-13 18:05:12 -04:00
Kevin K
3710cd6916
fix(tests): fix failing doc tests
2015-04-13 15:03:22 -04:00
Kevin K
d5d48bcf46
feat(app): add support for building args from usage strings
2015-04-13 14:32:27 -04:00
Kevin K
ab409a8f1d
feat(args): add ability to create basic arguments from a usage string
2015-04-13 13:31:14 -04:00
Kevin K
3d960e8be0
docs(clap): clean up docs and add better explainations
2015-04-10 19:21:34 -04:00
Kevin K
dcbadc6275
perf(usage): remove compiler warnings and dedup some code
2015-04-10 11:50:08 -04:00
Kevin K
3636afc401
feat(usage): add ability to get usage string for subcommands too
...
You can now get the usage even for sub-commands by calling the
usage() method.
Breaking Change
ArgMatches::usage() now returns a slice (no longer an Option<&str>)
This is to improve ergonomics, as there should always be at least a
default usage statement, there should never be None
2015-04-10 10:49:12 -04:00
Kevin K
5137278942
fix(usage): remove unneeded space
2015-04-09 21:43:26 -04:00
Kevin K
ba817b9d81
fix(usage): remove warning about unused variables
2015-04-09 19:53:13 -04:00
Kevin K
e2488e50e4
tests(subcommand help): change to new usage generation known good
2015-04-09 18:39:29 -04:00
Kevin K
02462150ca
feat(ArgMatches): add method to get default usage string
2015-04-09 18:18:51 -04:00
Kevin K
64e539280e
feat(SubCommands): add method to get name and subcommand matches together
2015-04-09 17:07:28 -04:00
Kevin K
042577d254
refactor(app.rs): remove unneeded hashmap use statement
2015-04-05 20:25:03 -04:00
Kevin K
f4b2bf5767
feat(help): sort arguments by name so as to not display a random order
2015-04-05 20:20:46 -04:00
Kevin K
90e72cffde
fix(flags): fix bug not allowing users to specify -v or -h
2015-04-04 16:13:51 -04:00
Kevin K
572bc31f08
style(app.rs): clean up misc items
2015-04-04 09:25:49 -04:00
Kevin K
ca17fa494b
fix(help): fix spacing when option argument has not long version
2015-04-03 11:50:09 -04:00
Kevin K
9abdb438e3
fix(clap): remove unstable features for Rust 1.0
2015-04-03 11:02:46 -04:00
Kevin K
18dbcf3702
fix(args): improve error messages for arguments with mutual exclusions
...
Closes #51
2015-04-02 22:34:36 -04:00
Kevin K
c14c3f31fd
fix(positional args): all previous positional args become required when
...
a latter one is required
Closes #50
2015-04-02 22:18:36 -04:00
Kevin K
e869100423
fix(help): fix formatting for option arguments with no long
2015-04-02 14:45:08 -04:00
Kevin K
a0a2a40fed
fix(flags): add assertion to catch flags with specific value sets
...
Closes #52
2015-04-01 20:16:45 -04:00
Kevin K
82ad6ad775
fix(option args): fix bug in getting the wrong number of occurrences for options
2015-04-01 20:14:49 -04:00
Kevin K
6ceb88a594
fix(args): fix bug in arguments who are required and mutually exclusive
...
When arguments are required-by-default and also mutually exclusive with
other arguments and the user chooses the mutually eclusive argument, the
requirements must be updated as well.
2015-04-01 13:22:53 -04:00
Kevin K
28691b52f6
fix(help): fix formatting of help and usage
2015-04-01 13:22:53 -04:00
Kevin K
6ec1011563
fix(help): fix formatting of help for flags and options
...
When options or flags have varying lengths of names and "long" version
the formatting gets corrupted because of the use of tabs. This commit
fixes those issues.
2015-04-01 13:22:53 -04:00
Kevin K
297ddba770
feat(help): add '...' to indicate multiple values supported
2015-04-01 13:22:53 -04:00
Kevin K
b7fa72d40f
feat(positionals): add assertions for positional args with multiple vals
2015-04-01 13:22:42 -04:00
Kevin K
8078400941
feat(positionals): add support for multiple values
...
Add support for #44 (multiple values for positional arguments) when the
positional argument is the last one (i.e. highest index)
2015-04-01 13:02:58 -04:00
Kevin K
da549dcb6c
fix(apps): allow use of hyphens in application and subcommand names
2015-04-01 13:01:00 -04:00
Kevin K
0a09eb365c
fix(args): determine if the only arguments allowed are also required
2015-04-01 12:57:26 -04:00
Kevin K
270eb88925
feat(args): add support for a specific set of allowed values on options
...
or positional arguments
2015-04-01 12:56:34 -04:00
Kevin K
1b7316d4a8
fix(usage): display required args in usage, even if only required by others
2015-04-01 12:50:35 -04:00
Kevin K
4ee023442a
feat(subcommands): properly list subcommands in help and usage
...
SubCommands should be listed as parent-subcommand in help, but parent
subcommand in usage
2015-04-01 12:47:55 -04:00
Kevin K
9af52e93ce
fix(option): fix bug with option occurrence values
2015-04-01 12:39:23 -04:00
Kevin K
9e8c1fb940
feat(arg): allow lifetimes other than 'static in arguments
2015-04-01 12:36:41 -04:00
Kevin K
564b1db183
removed unneeded ref in print_help() for options
2015-03-26 11:48:36 -04:00
Kevin K
de64e3d79f
Removed extra tab when printing help
2015-03-26 11:25:54 -04:00
Kevin K
0cce6b8715
Adding tests
2015-03-25 17:02:21 -04:00
Kevin K
b4caf8a21b
Removed unneeded Box<>
2015-03-25 13:48:01 -04:00
Kevin K
d906701b0e
testing to_owned()
2015-03-24 16:21:10 -04:00
Kevin K
b047104d9a
version bump and rebuilt docs
2015-03-24 14:35:47 -04:00
Kevin K
c7f22728f1
Added test application
2015-03-24 12:16:59 -04:00
Kevin K
6286d4b008
Closes #28 - Changed App name, version, about, author, and usage to allow lifetimes other than 'static
2015-03-23 22:34:01 -04:00
Kevin K
aed37da635
Bug fixes with multiple options
2015-03-22 22:48:46 -04:00
Kevin K
46bcf02a2f
Bug fixes
2015-03-22 22:26:07 -04:00
Kevin K
66dab46760
Fixed doc error
2015-03-22 22:13:10 -04:00
Kevin K
eff1ef4ff1
Fixed makefile bug
2015-03-22 22:03:28 -04:00
Kevin K
0f7bc363ce
Moved tests to tests/ directory and crate
2015-03-22 21:57:02 -04:00
Kevin K
d5d1554b5e
Cleaned up codebase...a little
2015-03-22 21:30:48 -04:00
Kevin K
cf4dc688a5
Fixed #22
2015-03-21 10:22:46 -04:00
J/A
1e1271ed8f
Remove assertion on multi args.
...
There's an assertion on line 322 of clap-rs/master that prevents any arg
where `multiple == true` from accepting any value. This commit only
deletes that assertion. It could cause any number of other problems; I
don't really know.
2015-03-19 00:26:50 -04:00
Kevin K.
dde61de645
Merge pull request #16 from untitaker/make
...
Add makefile magic
2015-03-18 21:20:10 -04:00
Kevin K
19c205b72d
Closes #17
2015-03-18 21:15:02 -04:00
Kevin K
01e3fc6ddd
Closes #17
2015-03-18 20:35:42 -04:00
Markus Unterwaditzer
5abee664b2
Deduplicate docs
2015-03-19 00:42:06 +01:00
Kevin K
96d28df880
Initial commit for multiple option arguments
2015-03-18 18:09:42 -04:00
Kevin K
f270bc171f
Restructured project to better reflect internal workings
2015-03-18 15:00:15 -04:00
Kevin K
85648f2949
Moved to stable Rust APIs - Removed uppercasing of argument names due to Rust API stability
2015-03-18 13:40:58 -04:00
Kevin K
ff8ea640e9
Moved some for loops to more readable iterators
2015-03-18 10:15:55 -04:00
Kevin K
399ad97413
Changes to stable APIs towards Rust 1.0
2015-03-18 08:41:09 -04:00
Kevin K
0594180e29
Added support for -- where only positional arguments follow
2015-03-17 20:53:56 -04:00
Kevin K
6ae91954ae
Fixes #9
2015-03-16 18:50:53 -04:00
Kevin K.
a0746686ac
Merge pull request #7 from untitaker/tabs
...
Improve formatting for README, remove some tabs
2015-03-16 16:51:32 -04:00
Markus Unterwaditzer
59bcd85662
Improve formatting for README, remove some tabs
2015-03-16 20:56:42 +01:00
Kevin K
55ce5c5eea
Fixed formatting error in doc example
2015-03-16 15:10:00 -04:00
Kevin K
eabfa091bc
Fixed error in doc test
2015-03-16 14:53:49 -04:00
Kevin K
9f4cdc9fa3
Changed tabs to spaces
2015-03-16 14:47:09 -04:00
Kevin K
1814d87192
Added custom usage strings
2015-03-16 14:28:56 -04:00
Kevin K
b77920304c
Fixed bug with un-needed subcommands (i.e. when no subcommand is specified by developer manually - and removed deprecated flags
2015-03-16 11:17:51 -04:00
Kevin K
152aa8919a
Fixed doc tests
2015-03-15 21:05:19 -04:00
Kevin K
e05ece7696
Fixed doc tests
2015-03-15 17:39:36 -04:00
Kevin K
65a8a4f045
Added support for subcommands
2015-03-15 17:17:52 -04:00
Kevin K
5ca006cbb5
Adding subcommands
2015-03-05 22:44:11 -05:00
Kevin K
d084a40f4a
Merge branch 'dev'
2015-03-03 22:42:06 -05:00
Kevin K
e057ed4e60
Moved to consuming builder pattern, removed unneeded fields
2015-03-03 22:41:47 -05:00
Kevin K
809b43995b
Removed extra keywords, fixed borrowing issues
2015-03-03 22:04:45 -05:00
Kevin K
90ca144f02
Removed extra keywords, fixed borrowing issues
2015-03-03 22:03:00 -05:00
Kevin K
42b7a35987
adding tests
2015-03-03 14:19:44 -05:00
Kevin K
9f5b33a241
adding tests
2015-03-03 14:18:56 -05:00
Kevin K
12a727e2a9
Added initial testing
2015-03-03 14:13:31 -05:00
Kevin K
498c13c264
Fixed error in docs
2015-03-03 13:57:19 -05:00
Kevin K
62704caf8d
Removed unneeded fields from Arg Matches
2015-03-03 13:10:19 -05:00
Kevin K
8548be883b
Fixed failing tests in the docs
2015-03-01 16:58:39 -05:00
Kevin K
3c0b050a26
updated docs
2015-02-28 20:15:04 -05:00
Kevin K
1c752d38d1
Arg names, shorts, and longs must now be unique
2015-02-28 20:10:19 -05:00
Kevin K
be61ff9842
Arg names, shorts, and longs must now be unique
2015-02-28 19:56:43 -05:00
Kevin K
e9a9273ec1
added cargo docs to github folder
2015-02-28 13:49:33 -05:00
Kevin K
e7fccf0cec
bug fixes
2015-02-28 13:43:58 -05:00
Kevin K
bce1aebd7c
bug fixes
2015-02-28 13:41:37 -05:00
Kevin K
8b2b7080b7
Added version and help to list of flags
2015-02-28 13:36:00 -05:00
Kevin K
72c360dbf6
Added documentation
2015-02-28 13:18:47 -05:00
Kevin K
b0b401ab07
Added documentation and fixed some bugs
2015-02-28 13:13:43 -05:00
Kevin K
3b02a6a373
Added documentation
2015-02-28 12:04:05 -05:00
Kevin K
1a0b06147c
Added documentation
2015-02-28 11:25:44 -05:00
Kevin K
1fbf99d1ff
Added documentation - and added args() to App
2015-02-28 11:10:48 -05:00
Kevin K
e15635d1c7
Re-addedd the pub-use
2015-02-28 10:45:31 -05:00
Kevin K
0bf13bd5f2
Added documentation - and removed a pub-use
2015-02-28 10:43:49 -05:00
Kevin K
1cb1dcb73f
Added documentation
2015-02-28 10:00:24 -05:00
Kevin K
da9607512b
Added documentation
2015-02-28 09:40:53 -05:00
Kevin K
044849f050
Removed deprecated method calls
2015-02-28 09:31:15 -05:00
Kevin K
22d7bb0c42
Removed Clone from FlagArg
2015-02-28 09:30:34 -05:00
Kevin K
3f693870bb
Adding documentation
2015-02-27 22:19:48 -05:00
Kevin K
335e9ff59b
v0.3.3.5 - Bug fix with black listing
2015-02-27 17:12:20 -05:00
Kevin K
7c0cc58621
v0.3.3.5 - Testing
2015-02-27 17:11:08 -05:00
Kevin K
447c40bd45
v0.3.3.4 - Bug fixes with blacklisting
2015-02-27 17:08:42 -05:00
Kevin K
b2f85de3e4
v0.3.3.3 - Reordered methods
2015-02-27 17:03:49 -05:00
Kevin K
a58b5d34b2
v0.3.3.2
2015-02-27 16:58:13 -05:00
Kevin K
c1836f8d1d
v0.3.3.1
2015-02-27 16:49:55 -05:00
Kevin K
8ee4e2dca5
v0.3.3
2015-02-27 16:47:33 -05:00
Kevin K
d5369ee1c0
v0.3.1.2
2015-02-27 16:24:29 -05:00
Kevin K
8a62206639
v0.3.1
2015-02-27 16:12:43 -05:00
Kevin K
e753b020e6
v0.0.5.6
2015-02-27 14:54:01 -05:00
Kevin K
3ab13ff0d1
v0.0.5.5
2015-02-27 14:27:34 -05:00
Kevin K
41f9fbbf95
v0.0.5.3
2015-02-27 12:34:00 -05:00
Kevin K
94a96676eb
v0.0.5.2
2015-02-27 12:32:43 -05:00
Kevin K
4992fcfd93
v0.0.5
2015-02-27 11:55:31 -05:00
Kevin K
5515ea064c
v0.0.4.10
2015-02-27 11:12:23 -05:00
Kevin K
baabac4eea
v0.0.4.9
2015-02-27 10:45:52 -05:00
Kevin K
ad11d7c7d4
v0.0.4.8
2015-02-26 23:56:51 -05:00
Kevin K
1cbe2ae894
v0.0.4.8
2015-02-26 23:55:54 -05:00
Kevin K
b3060ae12c
v0.0.4.5
2015-02-26 20:44:11 -05:00
Kevin K
b2852be529
v0.0.4.4
2015-02-26 20:43:16 -05:00
Kevin K
59d78cc9bd
v0.0.4.3
2015-02-26 20:31:04 -05:00
Kevin K
5a2cbb46c1
v0.0.4.2
2015-02-26 20:21:30 -05:00
Kevin K
530f546003
v0.0.4
2015-02-26 19:26:07 -05:00
Kevin K
55f402d8e4
v0.0.3.7
2015-02-26 19:14:44 -05:00
Kevin K
946395167b
Removed main.rs
2015-02-26 18:20:34 -05:00
Kevin K
11ea31c512
v0.0.3.6
2015-02-26 17:34:08 -05:00
Kevin K
385d67da49
v0.0.3.5
2015-02-26 16:25:40 -05:00
Kevin K
2da06a5194
Update
2015-02-26 15:49:04 -05:00
Kevin K
2d546238a2
Initial commit v0.0.3
2015-02-25 08:37:25 -05:00