mirror of
https://gitee.com/openharmony/third_party_rust_clap
synced 2024-11-23 15:10:33 +00:00
chore: Align on boilerplate
This commit is contained in:
parent
dd974168fd
commit
4e546dd2a1
1
.github/FUNDING.yml
vendored
1
.github/FUNDING.yml
vendored
@ -1 +0,0 @@
|
||||
open_collective: clap
|
45
.github/ISSUE_TEMPLATE.md
vendored
45
.github/ISSUE_TEMPLATE.md
vendored
@ -1,45 +0,0 @@
|
||||
<!--
|
||||
Please use the following template to assist with creating an issue and to ensure a speedy resolution. If an area is not applicable, feel free to delete the area or mark with `N/A`
|
||||
-->
|
||||
|
||||
### Rust Version
|
||||
|
||||
* Use the output of `rustc -V`
|
||||
|
||||
### Affected Version of clap
|
||||
|
||||
* Can be found in Cargo.lock of your project (i.e. `grep clap Cargo.lock`)
|
||||
|
||||
### Expected Behavior Summary
|
||||
|
||||
|
||||
### Actual Behavior Summary
|
||||
|
||||
|
||||
### Steps to Reproduce the issue
|
||||
|
||||
|
||||
### Sample Code or Link to Sample Code
|
||||
|
||||
|
||||
### Debug output
|
||||
|
||||
Compile clap with `debug` feature:
|
||||
|
||||
```toml
|
||||
[dependencies]
|
||||
clap = { version = "*", features = ["debug"] }
|
||||
```
|
||||
|
||||
The output may be very long, so feel free to link to a gist or attach a text file
|
||||
|
||||
<details>
|
||||
<summary> Debug Output </summary>
|
||||
<pre>
|
||||
<code>
|
||||
|
||||
Paste Debug Output Here
|
||||
|
||||
</code>
|
||||
</pre>
|
||||
</details>
|
28
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
28
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@ -1,27 +1,21 @@
|
||||
name: Bug report
|
||||
description: An issue with clap, clap_derive or clap_generate
|
||||
description: Things not quite working right
|
||||
labels: 'T: bug'
|
||||
body:
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Please complete the following tasks
|
||||
options:
|
||||
- label: I have searched the [discussions](https://github.com/clap-rs/clap/discussions)
|
||||
required: true
|
||||
- label: I have searched the existing issues
|
||||
required: true
|
||||
- type: input
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Rust Version
|
||||
description: Output of `rustc -V`
|
||||
label: Description
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: Clap Version
|
||||
label: Version
|
||||
description: Can be found in Cargo.lock or Cargo.toml of your project (i.e. `grep clap Cargo.lock`). PLEASE DO NOT PUT "latest" HERE, use precise version. Put `master` (or other branch) if you're using the repo directly.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Minimal reproducible code
|
||||
@ -32,28 +26,14 @@ body:
|
||||
```
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Steps to reproduce the bug with the above code
|
||||
description: A command like `cargo run -- options...` or multiple commands.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Actual Behaviour
|
||||
description: When I do like *this*, *that* is happening and I think it shouldn't.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Expected Behaviour
|
||||
description: I think *this* should happen instead.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional Context
|
||||
description: Add any other context about the problem here.
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Debug Output
|
||||
|
3
.github/ISSUE_TEMPLATE/config.yml
vendored
3
.github/ISSUE_TEMPLATE/config.yml
vendored
@ -1,6 +1,5 @@
|
||||
blank_issues_enabled: true
|
||||
contact_links:
|
||||
- name: Ask a question
|
||||
about: You've come to seek help or want to discuss something related to clap
|
||||
about: For support or brainstorming
|
||||
url: https://github.com/clap-rs/clap/discussions/new
|
||||
# TODO: Question template (waiting for discussions template feature)
|
||||
|
34
.github/ISSUE_TEMPLATE/documentation_issue.yml
vendored
34
.github/ISSUE_TEMPLATE/documentation_issue.yml
vendored
@ -1,34 +0,0 @@
|
||||
name: Documentation issue
|
||||
description: An issue with our docs, like typo, something's missing, incorrect docs, etc...
|
||||
labels: 'C: docs'
|
||||
body:
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Please complete the following tasks
|
||||
options:
|
||||
- label: I have searched the [discussions](https://github.com/clap-rs/clap/discussions)
|
||||
required: true
|
||||
- label: I have searched the existing issues
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: Clap Version
|
||||
description: Can be found in Cargo.lock or Cargo.toml of your project (i.e. `grep clap Cargo.lock`). PLEASE DO NOT PUT "latest" HERE, use precise version. Put `master` (or other branch) if you're using the repo directly.
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: Where?
|
||||
description: A hyperlink, file path, some item, *something*.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: What's wrong?
|
||||
description: Explain what the issue is about, like - "The doc says that the sun is green!".
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: How to fix?
|
||||
description: Any solution you think is right, like - "Everybody knows that the sun is blue!".
|
27
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
27
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
@ -4,35 +4,22 @@ labels: 'T: new feature'
|
||||
body:
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Please complete the following tasks
|
||||
options:
|
||||
- label: I have searched the [discussions](https://github.com/clap-rs/clap/discussions)
|
||||
required: true
|
||||
- label: I have searched the existing issues
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: Clap Version
|
||||
label: Version
|
||||
description: Can be found in Cargo.lock or Cargo.toml of your project (i.e. `grep clap Cargo.lock`). PLEASE DO NOT PUT "latest" HERE, use precise version. Put `master` (or other branch) if you're using the repo directly.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Describe your use case
|
||||
description: Describe the problem you're trying to solve. This is not mandatory and we *do* consider features without a specific use case, but real problems have priority.
|
||||
validations:
|
||||
required: true
|
||||
label: Use Case
|
||||
description: Describe the problem you're trying to solve.
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Describe the solution you'd like
|
||||
description: Please explain what the wanted solution should look like. You are **strongly encouraged** to attach a snippet of (pseudo)code.
|
||||
validations:
|
||||
required: true
|
||||
label: Requirements
|
||||
description: Describe what is needed to satisfy your use case.
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Alternatives, if applicable
|
||||
description: A clear and concise description of any alternative solutions or features you've managed to come up with.
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Additional Context
|
||||
description: Add any other context about the feature request here.
|
||||
label: Possible Solutions
|
||||
description: A clear and concise description of any solutions or features you've managed to come up with.
|
||||
|
5
.github/PULL_REQUEST_TEMPLATE.md
vendored
5
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -1,5 +0,0 @@
|
||||
<!--
|
||||
If your PR closes some issues, please write `Closes #XXXX`
|
||||
where `XXXX` is the number of the issue you want to fix.
|
||||
Each issue goes on its own line.
|
||||
-->
|
8
.github/dependabot.yml
vendored
Normal file
8
.github/dependabot.yml
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: cargo
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: monthly
|
||||
time: "07:00"
|
||||
open-pull-requests-limit: 10
|
48
.github/settings.yml
vendored
Normal file
48
.github/settings.yml
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
# These settings are synced to GitHub by https://probot.github.io/apps/settings/
|
||||
|
||||
repository:
|
||||
description: A full featured, fast Command Line Argument Parser for Rust
|
||||
homepage: docs.rs/clap
|
||||
topics: rust cli command-line argparse clap
|
||||
has_issues: true
|
||||
has_projects: false
|
||||
has_wiki: false
|
||||
has_downloads: true
|
||||
default_branch: main
|
||||
|
||||
allow_squash_merge: true
|
||||
allow_merge_commit: true
|
||||
allow_rebase_merge: true
|
||||
|
||||
# Manual: allow_auto_merge: true, see https://github.com/probot/settings/issues/402
|
||||
delete_branch_on_merge: true
|
||||
|
||||
labels:
|
||||
# Type
|
||||
- name: bug
|
||||
color: '#b60205'
|
||||
description: Not as expected
|
||||
- name: enhancement
|
||||
color: '#1d76db'
|
||||
description: Improve the expected
|
||||
# Flavor
|
||||
- name: question
|
||||
color: "#cc317c"
|
||||
description: Uncertainty is involved
|
||||
- name: breaking-change
|
||||
color: "#e99695"
|
||||
- name: good first issue
|
||||
color: '#c2e0c6'
|
||||
description: Help wanted!
|
||||
|
||||
branches:
|
||||
- name: main
|
||||
protection:
|
||||
required_pull_request_reviews: null
|
||||
required_conversation_resolution: true
|
||||
required_status_checks:
|
||||
# Required. Require branches to be up to date before merging.
|
||||
strict: false
|
||||
contexts: ["CI", "Lint Commits", "Spell Check with Typos"]
|
||||
enforce_admins: false
|
||||
restrictions: null
|
21
.github/workflows/audit.yml
vendored
Normal file
21
.github/workflows/audit.yml
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
name: Security audit
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '**/Cargo.toml'
|
||||
- '**/Cargo.lock'
|
||||
push:
|
||||
paths:
|
||||
- '**/Cargo.toml'
|
||||
- '**/Cargo.lock'
|
||||
schedule:
|
||||
- cron: '3 3 3 * *'
|
||||
jobs:
|
||||
security_audit:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
- uses: actions-rs/audit-check@v1
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
14
.github/workflows/committed.yml
vendored
Normal file
14
.github/workflows/committed.yml
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
name: Lint Commits
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
committed:
|
||||
name: Lint Commits
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Actions Repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Lint Commits
|
||||
uses: crate-ci/committed@master
|
12
.github/workflows/pre-commit.yml
vendored
Normal file
12
.github/workflows/pre-commit.yml
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
name: pre-commit
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches: [source]
|
||||
jobs:
|
||||
pre-commit:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-python@v2
|
||||
- uses: pre-commit/action@v2.0.3
|
12
.github/workflows/spelling.yml
vendored
Normal file
12
.github/workflows/spelling.yml
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
name: Spelling
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
spelling:
|
||||
name: Spell Check with Typos
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Actions Repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Spell Check Repo
|
||||
uses: crate-ci/typos@master
|
35
.gitignore
vendored
35
.gitignore
vendored
@ -1,35 +1,2 @@
|
||||
# Compiled files
|
||||
*.o
|
||||
*.so
|
||||
*.rlib
|
||||
*.dll
|
||||
|
||||
# Executables
|
||||
*.exe
|
||||
|
||||
# Generated by Cargo
|
||||
target/
|
||||
|
||||
# Cargo files
|
||||
target
|
||||
Cargo.lock
|
||||
|
||||
# Temp files
|
||||
.*~
|
||||
|
||||
# Backup files
|
||||
*.bak
|
||||
*.bk
|
||||
*.orig
|
||||
|
||||
# Project files
|
||||
.vscode/*
|
||||
.idea/*
|
||||
clap-rs.iml
|
||||
|
||||
# Auxiliary files
|
||||
test-results.test
|
||||
expanded.rs
|
||||
clap_derive/expanded.rs
|
||||
|
||||
# ctags
|
||||
**/*.vi
|
||||
|
21
.pre-commit-config.yaml
Normal file
21
.pre-commit-config.yaml
Normal file
@ -0,0 +1,21 @@
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v2.3.0
|
||||
hooks:
|
||||
- id: check-yaml
|
||||
stages: [commit]
|
||||
- id: check-json
|
||||
stages: [commit]
|
||||
- id: check-toml
|
||||
stages: [commit]
|
||||
- id: check-merge-conflict
|
||||
stages: [commit]
|
||||
- id: check-case-conflict
|
||||
stages: [commit]
|
||||
- id: detect-private-key
|
||||
stages: [commit]
|
||||
- repo: https://github.com/crate-ci/committed
|
||||
rev: v0.2.5
|
||||
hooks:
|
||||
- id: committed
|
||||
stages: [commit-msg]
|
101
Cargo.toml
101
Cargo.toml
@ -1,21 +1,22 @@
|
||||
[workspace]
|
||||
members = [
|
||||
"clap_derive",
|
||||
"clap_generate",
|
||||
"clap_generate_fig",
|
||||
]
|
||||
|
||||
[package]
|
||||
name = "clap"
|
||||
version = "3.0.0-beta.5"
|
||||
edition = "2018"
|
||||
description = "A simple to use, efficient, and full-featured Command Line Argument Parser"
|
||||
authors = [
|
||||
"Kevin K. <kbknapp@gmail.com>",
|
||||
"Clap Maintainers"
|
||||
]
|
||||
include = [
|
||||
"src/**/*",
|
||||
"Cargo.toml",
|
||||
"LICENSE-*",
|
||||
"README.md"
|
||||
]
|
||||
description = "A simple to use, efficient, and full-featured Command Line Argument Parser"
|
||||
repository = "https://github.com/clap-rs/clap"
|
||||
documentation = "https://docs.rs/clap/"
|
||||
homepage = "https://clap.rs/"
|
||||
categories = ["command-line-interface"]
|
||||
keywords = [
|
||||
"argument",
|
||||
"cli",
|
||||
@ -23,9 +24,51 @@ keywords = [
|
||||
"parser",
|
||||
"parse"
|
||||
]
|
||||
categories = ["command-line-interface"]
|
||||
edition = "2018"
|
||||
license = "MIT OR Apache-2.0"
|
||||
readme = "README.md"
|
||||
include = [
|
||||
"build.rs",
|
||||
"src/**/*",
|
||||
"Cargo.toml",
|
||||
"LICENSE*",
|
||||
"README.md",
|
||||
"benches/**/*",
|
||||
"examples/**/*"
|
||||
]
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
features = ["yaml", "regex", "unstable-replace", "unstable-multicall", "unstable-grouped"]
|
||||
|
||||
[features]
|
||||
default = [
|
||||
"std",
|
||||
"derive",
|
||||
"cargo",
|
||||
"color",
|
||||
"env",
|
||||
"suggestions",
|
||||
"unicode",
|
||||
]
|
||||
debug = ["clap_derive/debug", "backtrace"] # Enables debug messages
|
||||
|
||||
# Used in default
|
||||
std = ["indexmap/std"] # support for no_std in a backwards-compatible way
|
||||
derive = ["clap_derive", "lazy_static"]
|
||||
cargo = ["lazy_static"] # Disable if you're not using Cargo, enables Cargo-env-var-dependent macros
|
||||
color = ["atty", "termcolor"]
|
||||
env = [] # Use environment variables during arg parsing
|
||||
suggestions = ["strsim"]
|
||||
unicode = ["textwrap/unicode-width", "unicase"] # Support for unicode characters in arguments and help messages
|
||||
|
||||
# Optional
|
||||
wrap_help = ["terminal_size", "textwrap/terminal_size"]
|
||||
yaml = ["yaml-rust"]
|
||||
|
||||
# In-work features
|
||||
unstable-replace = []
|
||||
unstable-multicall = []
|
||||
unstable-grouped = []
|
||||
|
||||
[lib]
|
||||
bench = false
|
||||
@ -90,36 +133,6 @@ path = "examples/24a_multicall_busybox.rs"
|
||||
name = "hostname"
|
||||
path = "examples/24b_multicall_hostname.rs"
|
||||
|
||||
[features]
|
||||
default = [
|
||||
"std",
|
||||
"derive",
|
||||
"cargo",
|
||||
"color",
|
||||
"env",
|
||||
"suggestions",
|
||||
"unicode",
|
||||
]
|
||||
debug = ["clap_derive/debug", "backtrace"] # Enables debug messages
|
||||
|
||||
# Used in default
|
||||
std = ["indexmap/std"] # support for no_std in a backwards-compatible way
|
||||
derive = ["clap_derive", "lazy_static"]
|
||||
cargo = ["lazy_static"] # Disable if you're not using Cargo, enables Cargo-env-var-dependent macros
|
||||
color = ["atty", "termcolor"]
|
||||
env = [] # Use environment variables during arg parsing
|
||||
suggestions = ["strsim"]
|
||||
unicode = ["textwrap/unicode-width", "unicase"] # Support for unicode characters in arguments and help messages
|
||||
|
||||
# Optional
|
||||
wrap_help = ["terminal_size", "textwrap/terminal_size"]
|
||||
yaml = ["yaml-rust"]
|
||||
|
||||
# In-work features
|
||||
unstable-replace = []
|
||||
unstable-multicall = []
|
||||
unstable-grouped = []
|
||||
|
||||
[profile.test]
|
||||
opt-level = 1
|
||||
|
||||
@ -127,13 +140,3 @@ opt-level = 1
|
||||
lto = true
|
||||
codegen-units = 1
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
features = ["yaml", "regex", "unstable-replace", "unstable-multicall", "unstable-grouped"]
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
||||
[workspace]
|
||||
members = [
|
||||
"clap_derive",
|
||||
"clap_generate",
|
||||
"clap_generate_fig",
|
||||
]
|
||||
|
3
committed.toml
Normal file
3
committed.toml
Normal file
@ -0,0 +1,3 @@
|
||||
style="conventional"
|
||||
ignore_author_re="dependabot"
|
||||
merge_commit = false
|
Loading…
Reference in New Issue
Block a user