clap
====
[![Crates.io](https://img.shields.io/crates/v/clap.svg)](https://crates.io/crates/clap) [![Crates.io](https://img.shields.io/crates/d/clap.svg)](https://crates.io/crates/clap) [![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/clap-rs/clap/blob/master/LICENSE-MIT) [![Coverage Status](https://coveralls.io/repos/kbknapp/clap-rs/badge.svg?branch=master&service=github)](https://coveralls.io/github/kbknapp/clap-rs?branch=master) [![Join the chat at https://gitter.im/kbknapp/clap-rs](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/kbknapp/clap-rs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Linux: [![Build Status](https://travis-ci.org/clap-rs/clap.svg?branch=master)](https://travis-ci.org/clap-rs/clap)
Windows: [![Build status](https://ci.appveyor.com/api/projects/status/ejg8c33dn31nhv36/branch/master?svg=true)](https://ci.appveyor.com/project/kbknapp/clap-rs/branch/master)
Command Line Argument Parser for Rust
It is a simple-to-use, efficient, and full-featured library for parsing command line arguments and subcommands when writing console/terminal applications.
* [documentation](https://docs.rs/clap/)
* [website](https://clap.rs/)
* [video tutorials](https://www.youtube.com/playlist?list=PLza5oFLQGTl2Z5T8g1pRkIynR3E0_pc7U)
Table of Contents
=================
* [About](#about)
* [FAQ](#faq)
* [Features](#features)
* [Quick Example](#quick-example)
* [Try it!](#try-it)
* [Pre-Built Test](#pre-built-test)
* [BYOB (Build Your Own Binary)](#byob-build-your-own-binary)
* [Usage](#usage)
* [Optional Dependencies / Features](#optional-dependencies--features)
* [Dependencies Tree](#dependencies-tree)
* [More Information](#more-information)
* [Video Tutorials](#video-tutorials)
* [How to Contribute](#how-to-contribute)
* [Compatibility Policy](#compatibility-policy)
* [Minimum Version of Rust](#minimum-version-of-rust)
* [Related Crates](#related-crates)
* [License](#license)
* [Recent Breaking Changes](#recent-breaking-changes)
* [Deprecations](#deprecations)
Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc)
## About
`clap` is used to parse *and validate* the string of command line arguments provided by a user at runtime. You provide the list of valid possibilities, and `clap` handles the rest. This means you focus on your *applications* functionality, and less on the parsing and validating of arguments.
`clap` provides many things 'for free' (with no configuration) including the traditional version and help switches (or flags) along with associated messages. If you are using subcommands, `clap` will also auto-generate a `help` subcommand and separate associated help messages.
Once `clap` parses the user provided string of arguments, it returns the matches along with any applicable values. If the user made an error or typo, `clap` informs them with a friendly message and exits gracefully (or returns a `Result` type and allows you to perform any clean up prior to exit). Because of this, you can make reasonable assumptions in your code about the validity of the arguments prior to your applications main execution.
## FAQ
For a full FAQ and more in depth details, see [the wiki page](https://github.com/clap-rs/clap/wiki/FAQ)
### Comparisons
First, let me say that these comparisons are highly subjective, and not meant in a critical or harsh manner. All the argument parsing libraries out there (to include `clap`) have their own strengths and weaknesses. Sometimes it just comes down to personal taste when all other factors are equal. When in doubt, try them all and pick one that you enjoy :) There's plenty of room in the Rust community for multiple implementations!
#### How does `clap` compare to [getopts](https://github.com/rust-lang-nursery/getopts)?
`getopts` is a very basic, fairly minimalist argument parsing library. This isn't a bad thing, sometimes you don't need tons of features, you just want to parse some simple arguments, and have some help text generated for you based on valid arguments you specify. The downside to this approach is that you must manually implement most of the common features (such as checking to display help messages, usage strings, etc.). If you want a highly custom argument parser, and don't mind writing the majority of the functionality yourself, `getopts` is an excellent base.
`getopts` also doesn't allocate much, or at all. This gives it a very small performance boost. Although, as you start implementing additional features, that boost quickly disappears.
Personally, I find many, many uses of `getopts` are manually implementing features that `clap` provides by default. Using `clap` simplifies your codebase allowing you to focus on your application, and not argument parsing.
#### How does `clap` compare to [docopt.rs](https://github.com/docopt/docopt.rs)?
I first want to say I'm a big a fan of BurntSushi's work, the creator of `Docopt.rs`. I aspire to produce the quality of libraries that this man does! When it comes to comparing these two libraries they are very different. `docopt` tasks you with writing a help message, and then it parsers that message for you to determine all valid arguments and their use. Some people LOVE this approach, others do not. If you're willing to write a detailed help message, it's nice that you can stick that in your program and have `docopt` do the rest. On the downside, it's far less flexible.
`docopt` is also excellent at translating arguments into Rust types automatically. There is even a syntax extension which will do all this for you, if you're willing to use a nightly compiler (use of a stable compiler requires you to somewhat manually translate from arguments to Rust types). To use BurntSushi's words, `docopt` is also a sort of black box. You get what you get, and it's hard to tweak implementation or customize the experience for your use case.
Because `docopt` is doing a ton of work to parse your help messages and determine what you were trying to communicate as valid arguments, it's also one of the more heavy weight parsers performance-wise. For most applications this isn't a concern and this isn't to say `docopt` is slow, in fact far from it. This is just something to keep in mind while comparing.
#### All else being equal, what are some reasons to use `clap`? (The Pitch)
`clap` is as fast, and as lightweight as possible while still giving all the features you'd expect from a modern argument parser. In fact, for the amount and type of features `clap` offers it remains about as fast as `getopts`. If you use `clap` when just need some simple arguments parsed, you'll find it's a walk in the park. `clap` also makes it possible to represent extremely complex, and advanced requirements, without too much thought. `clap` aims to be intuitive, easy to use, and fully capable for wide variety use cases and needs.
#### All else being equal, what are some reasons *not* to use `clap`? (The Anti Pitch)
Depending on the style in which you choose to define the valid arguments, `clap` can be very verbose. `clap` also offers so many fine-tuning knobs and dials, that learning everything can seem overwhelming. I strive to keep the simple cases simple, but when turning all those custom dials it can get complex. `clap` is also opinionated about parsing. Even though so much can be tweaked and tuned with `clap` (and I'm adding more all the time), there are still certain features which `clap` implements in specific ways which may be contrary to some users use-cases. Finally, `clap` is "stringly typed" when referring to arguments which can cause typos in code. This particular paper-cut is being actively worked on, and should be gone in v3.x.
## Features
Below are a few of the features which `clap` supports, full descriptions and usage can be found in the [documentation](https://docs.rs/clap/) and [examples/](examples) directory
* **Auto-generated Help, Version, and U
没有合适的资源?快使用搜索试试~ 我知道了~
DPSC——挑战杯——入侵防御系统.zip
共2000个文件
c:1039个
h:421个
md:157个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 132 浏览量
2023-11-09
01:18:31
上传
评论
收藏 109.27MB ZIP 举报
温馨提示
挑战杯大赛相关代码、设计文档、使用说明,供参考 挑战杯大赛相关代码、设计文档、使用说明,供参考 挑战杯大赛相关代码、设计文档、使用说明,供参考 挑战杯大赛相关代码、设计文档、使用说明,供参考 挑战杯大赛相关代码、设计文档、使用说明,供参考 挑战杯大赛相关代码、设计文档、使用说明,供参考 挑战杯大赛相关代码、设计文档、使用说明,供参考 挑战杯大赛相关代码、设计文档、使用说明,供参考 挑战杯大赛相关代码、设计文档、使用说明,供参考 挑战杯大赛相关代码、设计文档、使用说明,供参考 挑战杯大赛相关代码、设计文档、使用说明,供参考 挑战杯大赛相关代码、设计文档、使用说明,供参考 挑战杯大赛相关代码、设计文档、使用说明,供参考 挑战杯大赛相关代码、设计文档、使用说明,供参考 挑战杯大赛相关代码、设计文档、使用说明,供参考 挑战杯大赛相关代码、设计文档、使用说明,供参考 挑战杯大赛相关代码、设计文档、使用说明,供参考 挑战杯大赛相关代码、设计文档、使用说明,供参考 挑战杯大赛相关代码、设计文档、使用说明,供参考 挑战杯大赛相关代码、设计文档、使用说明,供参考 挑战杯大赛相关代码、设计文档、使用说明,供参考
资源推荐
资源详情
资源评论
收起资源包目录
DPSC——挑战杯——入侵防御系统.zip (2000个子文件)
detect-fast-pattern.c 597KB
stream-tcp.c 358KB
detect-http-server-body.c 278KB
detect-http-host.c 252KB
app-layer-htp.c 235KB
detect-http-uri.c 223KB
app-layer-ssl.c 194KB
detect.c 164KB
util-lua-dnp3-objects.c 159KB
detect-engine-address.c 145KB
detect-http-header.c 145KB
detect-engine.c 145KB
detect-byte-extract.c 143KB
util-radix-tree.c 132KB
util-mpm-b2g.c 131KB
detect-http-raw-header.c 131KB
app-layer-detect-proto.c 130KB
stream-tcp-reassemble.c 128KB
util-spm.c 126KB
detect-pcre.c 119KB
app-layer.c 112KB
detect-content.c 109KB
app-layer-modbus.c 107KB
detect-http-user-agent.c 105KB
detect-http-client-body.c 101KB
suricata.c 98KB
util-mpm-wumanber.c 97KB
detect-dce-opnum.c 97KB
detect-engine-dcepayload.c 96KB
detect-lua.c 90KB
source-af-packet.c 88KB
util-threshold-config.c 87KB
output-json-dnp3-objects.c 84KB
detect-engine-iponly.c 83KB
htp_util.c 81KB
detect-http-cookie.c 78KB
detect-http-stat-code.c 71KB
util-napatech.c 71KB
detect-engine-sigorder.c 69KB
detect-engine-port.c 69KB
defrag.c 69KB
detect-http-stat-msg.c 68KB
detect-http-method.c 65KB
tm-threads.c 65KB
detect.c 64KB
detect-engine-build.c 62KB
util-mpm-hs.c 60KB
app-layer-parser.c 59KB
detect-engine-mpm.c 59KB
htp_multipart.c 58KB
app-layer-ftp.c 57KB
htp_transaction.c 54KB
detect-tls-cert-validity.c 54KB
decode-ipv4.c 54KB
decode-icmpv6.c 54KB
detect-bytetest.c 53KB
htp_response.c 53KB
util-host-os-info.c 51KB
runmode-unix-socket.c 51KB
app-layer-ssh.c 50KB
detect-threshold.c 49KB
util-streaming-buffer.c 49KB
util-action.c 47KB
flow.c 47KB
util-profiling.c 46KB
runmode-dpdk.c 46KB
flow-manager.c 45KB
counters.c 44KB
app-layer-htp-file.c 43KB
detect-flowint.c 43KB
output-json.c 42KB
util-hash-lookup3.c 42KB
htp_config.c 39KB
detect-engine-address-ipv4.c 39KB
htp_request.c 39KB
source-napatech.c 38KB
unix-manager.c 38KB
alert-prelude.c 38KB
detect-engine-payload.c 38KB
conf.c 38KB
decode-ipv6.c 36KB
detect-flow.c 35KB
detect-csum.c 35KB
detect-modbus.c 35KB
util-ebpf.c 35KB
detect-http2.c 35KB
detect-tcp-flags.c 34KB
detect-hostbits.c 33KB
LzmaDec.c 32KB
util-file.c 31KB
detect-dns-query.c 30KB
runmodes.c 30KB
output-lua.c 28KB
app-layer-enip-common.c 28KB
util-debug-filters.c 28KB
conf-yaml-loader.c 28KB
detect-engine-content-inspection.c 27KB
detect-replace.c 26KB
detect-iprep.c 26KB
decode-icmpv4.c 26KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
辣椒种子
- 粉丝: 3362
- 资源: 5724
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功