|
25 | 25 | //!
|
26 | 26 | //! The following examples show a quick example of some of the very basic functionality of `clap`.
|
27 | 27 | //! For more advanced usage, such as requirements, exclusions, groups, multiple values and
|
28 |
| -//! occurrences see the [video tutorials](https://www.youtube.com/playlist?list=PLza5oFLQGTl0Bc_EU_pBNcX-rhVqDTRxv), |
29 |
| -//! [documentation](http://kbknapp.github.io/clap-rs/clap/index.html), or [examples/](https://github.com/kbknapp/clap-rs/tree/master/examples) |
30 |
| -//! directory of this repository. |
| 28 | +//! occurrences see the [video tutorials][video tutorials], [documentation][docs], or |
| 29 | +//! [examples/][examples] directory of this crate's repository. |
31 | 30 | //!
|
32 | 31 | //! **NOTE:** All these examples are functionally the same, but show three different styles in
|
33 | 32 | //! which to use `clap`
|
|
90 | 89 | //! The following example is functionally the same as the one above, but this method allows more
|
91 | 90 | //! advanced configuration options (not shown in this small example), or even dynamically
|
92 | 91 | //! generating arguments when desired. Both methods can be used together to get the best of both
|
93 |
| -//! worlds (see the documentation, [examples/](https://github.com/kbknapp/clap-rs/tree/master/examples), |
94 |
| -//! or video tutorials). |
| 92 | +//! worlds (see the documentation, [examples/][examples], or video tutorials). |
95 | 93 | //!
|
96 | 94 | //! ```no_run
|
97 | 95 | //! // (Full example with detailed comments in examples/01b_quick_example.rs)
|
|
222 | 220 | //! tidy. First, create the `cli.yml` file to hold your CLI options, but it could be called
|
223 | 221 | //! anything we like (we'll use the same both examples above to keep it functionally equivilant):
|
224 | 222 | //!
|
225 |
| -//! ```ignore |
| 223 | +//! ```yaml |
226 | 224 | //! name: myapp
|
227 | 225 | //! version: 1.0
|
228 | 226 | //! author: Kevin K. <[email protected]>
|
|
307 | 305 | //! may not need. Simply change your `clap = "1"` to `clap = {version = "1", features = ["yaml"]}`
|
308 | 306 | //! in your `Cargo.toml` to use the YAML version.
|
309 | 307 | //!
|
310 |
| -//! ```ignore |
| 308 | +//! ```text |
311 | 309 | //! $ myapp --help
|
312 | 310 | //! myapp 1.0
|
313 | 311 |
|
|
352 | 350 | //! * Create a new cargo project `$ cargo new fake --bin && cd fake`
|
353 | 351 | //! * Add `clap` to your `Cargo.toml`
|
354 | 352 | //! *
|
355 |
| -//! ```ignore |
| 353 | +//! ```toml |
356 | 354 | //! [dependencies]
|
357 | 355 | //! clap = "1"
|
358 | 356 | //! ```
|
|
375 | 373 | //!
|
376 | 374 | //! For full usage, add `clap` as a dependency in your `Cargo.toml` file to use from crates.io:
|
377 | 375 | //!
|
378 |
| -//! ```ignore |
| 376 | +//! ```toml |
379 | 377 | //! [dependencies]
|
380 | 378 | //! clap = "1"
|
381 | 379 | //! ```
|
382 | 380 | //! Or track the latest on the master branch at github:
|
383 | 381 | //!
|
384 |
| -//! ```ignore |
| 382 | +//! ```toml |
385 | 383 | //! [dependencies.clap]
|
386 | 384 | //! git = "https://github.com/kbknapp/clap-rs.git"
|
387 | 385 | //! ```
|
388 | 386 | //!
|
389 | 387 | //! Add `extern crate clap;` to your crate root.
|
390 | 388 | //!
|
391 |
| -//! Define a list of valid arguments for your program (see the [documentation](https://kbknapp.github.io/clap-rs/index.html) |
392 |
| -//! or [examples/](https://github.com/kbknapp/clap-rs/tree/master/examples) directory of this repo) |
| 389 | +//! Define a list of valid arguments for your program (see the [documentation][docs] or |
| 390 | +//! [examples/][examples] directory of this repo) |
393 | 391 | //!
|
394 | 392 | //! Then run `cargo build` or `cargo update && cargo build` for your project.
|
395 | 393 | //!
|
|
398 | 396 | //! If you'd like to keep your dependency list to **only** `clap`, you can disable any features
|
399 | 397 | //! that require an additional dependency. To do this, add this to your `Cargo.toml`:
|
400 | 398 | //!
|
401 |
| -//! ```ignore |
| 399 | +//! ```toml |
402 | 400 | //! [dependencies.clap]
|
403 | 401 | //! version = "1"
|
404 | 402 | //! default-features = false
|
405 | 403 | //! ```
|
406 | 404 | //!
|
407 | 405 | //! You can also selectively enable only the features you'd like to include, by adding:
|
408 | 406 | //!
|
409 |
| -//! ```ignore |
| 407 | +//! ```toml |
410 | 408 | //! [dependencies.clap]
|
411 | 409 | //! version = "1"
|
412 | 410 | //! default-features = false
|
|
434 | 432 | //!
|
435 | 433 | //! ### More Information
|
436 | 434 | //!
|
437 |
| -//! You can find complete documentation on the [github-pages site](http://kbknapp.github.io/clap-rs/clap/index.html) |
438 |
| -//! for this project. |
| 435 | +//! You can find complete documentation on the [github-pages site][docs] for this project. |
439 | 436 | //!
|
440 |
| -//! You can also find usage examples in the [examples/](https://github.com/kbknapp/clap-rs/tree/master/examples) |
441 |
| -//! directory of this repo. |
| 437 | +//! You can also find usage examples in the [examples/][examples] directory of this repo. |
442 | 438 | //!
|
443 | 439 | //! #### Video Tutorials
|
444 | 440 | //!
|
445 |
| -//! There's also the video tutorial series [Argument Parsing with Rust](https://www.youtube.com/playlist?list=PLza5oFLQGTl0Bc_EU_pBNcX-rhVqDTRxv) |
446 |
| -//! that I've been working on. |
| 441 | +//! There's also the video tutorial series [Argument Parsing with Rust][video tutorials] that I've |
| 442 | +//! been working on. |
447 | 443 | //!
|
448 | 444 | //! *Note*: Two new videos have just been added ([08 From Usage](https://youtu.be/xc6VdedFrG0), and
|
449 | 445 | //! [09 Typed Values](https://youtu.be/mZn3C1DnD90)), if you're already familiar with `clap` but
|
|
457 | 453 | //!
|
458 | 454 | //! If contributing, you can run the tests as follows (assuming you're in the `clap-rs` directory)
|
459 | 455 | //!
|
460 |
| -//! ```ignore |
| 456 | +//! ```sh |
461 | 457 | //! cargo test --features yaml && make -C clap-tests test
|
462 | 458 | //! ```
|
463 | 459 | //!
|
464 | 460 | //! ## License
|
465 | 461 | //!
|
466 |
| -//! `clap` is licensed under the MIT license. Please read the [LICENSE-MIT](https://raw.githubusercontent.com/kbknapp/clap-rs/master/LICENSE-MIT) |
| 462 | +//! `clap` is licensed under the MIT license. Please read the [LICENSE-MIT][license] |
467 | 463 | //! file in
|
468 | 464 | //! this repository for more information.
|
| 465 | +//! |
| 466 | +//! [examples]: https://github.com/kbknapp/clap-rs/tree/master/examples |
| 467 | +//! [docs]: http://kbknapp.github.io/clap-rs/clap/index.html |
| 468 | +//! [video tutorials]: https://www.youtube.com/playlist?list=PLza5oFLQGTl0Bc_EU_pBNcX-rhVqDTRxv |
| 469 | +//! [license]: https://raw.githubusercontent.com/kbknapp/clap-rs/master/LICENSE-MIT |
469 | 470 |
|
470 | 471 | #![crate_type= "lib"]
|
471 | 472 | #![cfg_attr(feature = "nightly", feature(plugin))]
|
|
0 commit comments