Merge branch 'master' into infer2

This commit is contained in:
João Marcos Bezerra 2021-11-14 02:11:28 -03:00 committed by GitHub
commit fe4b265d9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 58 additions and 22 deletions

View File

@ -1,12 +0,0 @@
---
name: Bug Report
about: Any Ouch bug
title: '_[BUG]_ '
labels: bug
assignees: ''
---
Thanks for filling a bug report!
Don't forget to add the `ouch` version for which this error occurred.

40
.github/ISSUE_TEMPLATE/bug-report.yml vendored Normal file
View File

@ -0,0 +1,40 @@
name: Bug Report
description: Report a ouch bug
labels: [bug]
body:
- type: markdown
attributes:
value: Thanks for filling a bug report!
- type: input
id: version
attributes:
label: Version
description: Version of ouch you encountered this error, or git commit hash if you are not using a versioned release
validations:
required: true
- type: textarea
id: description
attributes:
label: Description
validations:
required: true
- type: textarea
id: current
attributes:
label: Current Behavior
- type: textarea
id: expected
attributes:
label: Expected Behavior
- type: textarea
id: info
attributes:
label: Additional Information
description: >
Additional information that might help us debug this issue,
such as the operating system you are using or the files you tried to archive/extract

View File

@ -1,10 +1,6 @@
---
name: Documentation Improvement
about: Improvements in repository markdown or code docs
title: '_[DOCS]_ '
about: Improvements in repository markdown or code documentations
labels: documentation
assignees: ''
---

View File

@ -0,0 +1,6 @@
---
name: Feature / Enhancement
about: Features or change you want to see in ouch
labels: enhancement
---

6
.github/ISSUE_TEMPLATE/question.md vendored Normal file
View File

@ -0,0 +1,6 @@
---
name: Question
about: "Ask a question about ouch. You can also ask questions in discussions: https://github.com/ouch-org/ouch/discussions"
labels: question
---

View File

@ -70,19 +70,19 @@ pub fn try_infer_extension(path: &Path) -> Option<Extension> {
buf.len() > 261 && buf[257..=261] == [0x75, 0x73, 0x74, 0x61, 0x72]
}
fn is_gz(buf: &[u8]) -> bool {
buf.len() > 2 && buf[..=2] == [0x1F, 0x8B, 0x8]
buf.starts_with(&[0x1F, 0x8B, 0x8])
}
fn is_bz2(buf: &[u8]) -> bool {
buf.len() > 2 && buf[..=2] == [0x42, 0x5A, 0x68]
buf.starts_with(&[0x42, 0x5A, 0x68])
}
fn is_xz(buf: &[u8]) -> bool {
buf.len() > 5 && buf[..=5] == [0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00]
buf.starts_with(&[0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00])
}
fn is_lz4(buf: &[u8]) -> bool {
buf.len() > 3 && buf[..=3] == [0x04, 0x22, 0x4D, 0x18]
buf.starts_with(&[0x04, 0x22, 0x4D, 0x18])
}
fn is_zst(buf: &[u8]) -> bool {
buf.len() > 3 && buf[..=3] == [0x28, 0xB5, 0x2F, 0xFD]
buf.starts_with(&[0x28, 0xB5, 0x2F, 0xFD])
}
let buf = {