mirror of
https://github.com/sharkdp/hexyl.git
synced 2026-10-30 09:05:54 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5981fc8725 | ||
|
|
f4515b0f14 | ||
|
|
e3d406dd95 | ||
|
|
b6b7e2c79a | ||
|
|
dfad7b3faf | ||
|
|
ef9b530d6a | ||
|
|
a3268b8791 | ||
|
|
2a534483c8 | ||
|
|
e6ba196bcb | ||
|
|
d0bd971382 | ||
|
|
8eed3cadbb | ||
|
|
38a9662ea5 | ||
|
|
e10136d203 | ||
|
|
5f0373184f | ||
|
|
57d18482ba | ||
|
|
816779e968 | ||
|
|
9be018fbb9 | ||
|
|
cba717b783 | ||
|
|
580f865c4a | ||
|
|
20450310c9 | ||
|
|
b251575d94 | ||
|
|
58b038af27 | ||
|
|
d703cdfd78 | ||
|
|
43f8b92502 | ||
|
|
a966896d3f | ||
|
|
08b903270f | ||
|
|
dd601e4792 | ||
|
|
564cf64b1b | ||
|
|
c24280620a | ||
|
|
bfa2726e05 | ||
|
|
d6af232691 | ||
|
|
cc6987e270 | ||
|
|
ee56a3396d | ||
|
|
4833c2afe4 | ||
|
|
dfd7bdef49 | ||
|
|
fd4aee2b85 | ||
|
|
cf8e7ec079 | ||
|
|
faa9866d11 | ||
|
|
1df35eeb63 | ||
|
|
437a15f3d6 | ||
|
|
70fa092df1 | ||
|
|
b2f0e75ed2 | ||
|
|
4fc0c1f1b0 | ||
|
|
4ce6e9d799 | ||
|
|
5bd76fd11b | ||
|
|
c7e2235293 | ||
|
|
421bd73ec1 | ||
|
|
e888021a48 | ||
|
|
7d38f70918 | ||
|
|
c6af2edda8 | ||
|
|
a7fadfaaf2 | ||
|
|
8577a17b14 | ||
|
|
2d8b600c48 | ||
|
|
f8601e5bc9 | ||
|
|
9770b89cf4 | ||
|
|
571312dd6e | ||
|
|
fcd09fffac | ||
|
|
188e753675 | ||
|
|
030235afb7 | ||
|
|
7847e8cd33 | ||
|
|
32f4ce9987 | ||
|
|
2a4b17a162 | ||
|
|
5e3c49f933 | ||
|
|
fc794b290c | ||
|
|
e6000a56f4 | ||
|
|
2861cd51ac | ||
|
|
a8cffbb6df | ||
|
|
7bb6343d2a | ||
|
|
7de17c4f35 | ||
|
|
ec61c2a789 | ||
|
|
7f7b88a914 | ||
|
|
85fa75ba67 | ||
|
|
d5d645fc48 | ||
|
|
8d3aa65134 | ||
|
|
252b4e84c3 | ||
|
|
3dc118d0ad | ||
|
|
b1ff8b6ce4 | ||
|
|
fe65792b96 | ||
|
|
31c0bcfeae | ||
|
|
c0f94ad6aa | ||
|
|
55fed5e3c0 | ||
|
|
aeee0a1033 | ||
|
|
179c8f40a2 | ||
|
|
fb2500d7d6 | ||
|
|
ad9ecda952 | ||
|
|
c43effefd6 | ||
|
|
0b6454ed9d | ||
|
|
557ae66ed5 | ||
|
|
df1afdc73f | ||
|
|
9106b899b2 | ||
|
|
df1c36e5a7 | ||
|
|
ac610f7bad | ||
|
|
767740865f | ||
|
|
1fb324f411 | ||
|
|
3d0bc3d0eb | ||
|
|
8a52261a50 | ||
|
|
ccc4fb9ba9 | ||
|
|
0baa22f152 | ||
|
|
165ced9307 | ||
|
|
3888a20dfe | ||
|
|
75b37fa125 | ||
|
|
794e1935e3 | ||
|
|
c49aa079b4 | ||
|
|
675ef6d4a8 | ||
|
|
eade38c94a | ||
|
|
98ceec18cd | ||
|
|
a49f295acc | ||
|
|
0caab15255 | ||
|
|
828fb210ce | ||
|
|
1e43783616 | ||
|
|
6b7cfefec6 | ||
|
|
5f82942f98 | ||
|
|
f6a1c4e8e3 | ||
|
|
b4fb1b079c | ||
|
|
f9f59d653d | ||
|
|
c82695f0a9 | ||
|
|
9d938b11ed | ||
|
|
d5982c0eb0 | ||
|
|
1502419ad4 | ||
|
|
f5be845d70 | ||
|
|
664025477b | ||
|
|
074bc791c2 | ||
|
|
77a4ad25f1 | ||
|
|
ca31d466ba | ||
|
|
945e7a3472 | ||
|
|
75d612ff11 | ||
|
|
15e8abfc9a | ||
|
|
b36d74ed9d | ||
|
|
094bf63f02 | ||
|
|
e0e870de27 | ||
|
|
966421c522 | ||
|
|
166c2cc46b | ||
|
|
74a5e4bc84 | ||
|
|
363ea0a586 | ||
|
|
1c4c7ed9a5 | ||
|
|
b5c224c119 | ||
|
|
d6e34d9dd2 | ||
|
|
1cb346bd13 | ||
|
|
daa40900bd | ||
|
|
d98c6edb55 | ||
|
|
73bfc68cd0 | ||
|
|
5d3f36d066 | ||
|
|
d214bc63f1 | ||
|
|
a6aeabfde4 | ||
|
|
9602667991 | ||
|
|
9ccf18f4c0 | ||
|
|
aa921ca184 | ||
|
|
4823523b7d | ||
|
|
4569c8f871 | ||
|
|
80163764c3 | ||
|
|
9bc81820e7 | ||
|
|
273ef0c045 | ||
|
|
ac1a67e90c | ||
|
|
12324d615a | ||
|
|
6b062ba127 | ||
|
|
8c7c3a073c | ||
|
|
0565901fad | ||
|
|
41b3241718 | ||
|
|
975a406d20 | ||
|
|
aa43c20f39 | ||
|
|
1fdd770093 | ||
|
|
a3fde45c18 | ||
|
|
85659a9cd6 | ||
|
|
2a4a22c9cb | ||
|
|
b820bdfeca | ||
|
|
b9348ffb1d | ||
|
|
55cf7b034c | ||
|
|
c622c8217f | ||
|
|
49484fa0f0 | ||
|
|
3661b06b60 | ||
|
|
f5814d4442 | ||
|
|
49ebf4771f | ||
|
|
4904a7e26f | ||
|
|
becc1b80f1 | ||
|
|
1fb5263c3b | ||
|
|
0ae89168ad | ||
|
|
6873867658 | ||
|
|
f15e049bf5 | ||
|
|
1d04cdf119 | ||
|
|
5d92f07e21 | ||
|
|
a4ed50e1f0 | ||
|
|
f7f7447994 | ||
|
|
e4f0e8a092 | ||
|
|
a23645ddfd | ||
|
|
7da04c6bff | ||
|
|
c497c1fac9 | ||
|
|
653cf02954 | ||
|
|
18cdbe02c5 | ||
|
|
d1ae68585f | ||
|
|
7a225fe732 | ||
|
|
1b33e516d9 | ||
|
|
55d02c933a | ||
|
|
b8ed8d5df9 | ||
|
|
641c32e395 | ||
|
|
51b28ed0b0 | ||
|
|
825100c6d6 | ||
|
|
1b1fc4b053 | ||
|
|
c3dd4e871e | ||
|
|
923bceffaa | ||
|
|
2942d2419f | ||
|
|
37d4180f9a | ||
|
|
99435cd215 | ||
|
|
27f039d72a | ||
|
|
e72422ecfb | ||
|
|
3c56ed2b0e | ||
|
|
a09ea8ee27 | ||
|
|
d6bdfe9897 | ||
|
|
7c9f7e1bd0 | ||
|
|
b1d2a47590 | ||
|
|
c3e9cb9518 | ||
|
|
3489998c67 | ||
|
|
4594d29f73 | ||
|
|
cc73f01c34 | ||
|
|
6da15cd1e9 | ||
|
|
c82ccd5a59 | ||
|
|
19d2805729 | ||
|
|
06387bba3e | ||
|
|
595803e5e2 | ||
|
|
3793559d6f | ||
|
|
71626c28e9 | ||
|
|
532eab762d | ||
|
|
642eff6061 | ||
|
|
15dc96a946 | ||
|
|
6b2cc80cc1 | ||
|
|
1db77094da | ||
|
|
8c3f2230c6 | ||
|
|
66f8508b57 | ||
|
|
afb249e854 | ||
|
|
9432677d3a | ||
|
|
524a6c607f | ||
|
|
d69a7d8e04 | ||
|
|
b1c8606918 | ||
|
|
d9723592bf | ||
|
|
23fbb5b027 | ||
|
|
4d7004f06b | ||
|
|
c4ed6d9936 | ||
|
|
aab0596ea9 | ||
|
|
7500efffa5 | ||
|
|
80e8026416 | ||
|
|
13452f5174 | ||
|
|
48ff6ff956 | ||
|
|
54cab89821 | ||
|
|
bb6a3c0650 | ||
|
|
09c22e09b9 | ||
|
|
cc5b308fc9 | ||
|
|
153b1cccdf | ||
|
|
7217a60e6e | ||
|
|
13aec946a3 | ||
|
|
e0da7b3f82 | ||
|
|
e29a63358d | ||
|
|
2bdf5d768f | ||
|
|
a7892881f3 | ||
|
|
921a138962 |
No files matched your search
@@ -0,0 +1,334 @@
|
|||||||
|
name: CICD
|
||||||
|
|
||||||
|
env:
|
||||||
|
CICD_INTERMEDIATES_DIR: "_cicd-intermediates"
|
||||||
|
MSRV_FEATURES: ""
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
crate_metadata:
|
||||||
|
name: Extract crate metadata
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Extract crate information
|
||||||
|
id: crate_metadata
|
||||||
|
run: |
|
||||||
|
cargo metadata --no-deps --format-version 1 | jq -r '"name=" + .packages[0].name' | tee -a $GITHUB_OUTPUT
|
||||||
|
cargo metadata --no-deps --format-version 1 | jq -r '"version=" + .packages[0].version' | tee -a $GITHUB_OUTPUT
|
||||||
|
cargo metadata --no-deps --format-version 1 | jq -r '"maintainer=" + .packages[0].authors[0]' | tee -a $GITHUB_OUTPUT
|
||||||
|
cargo metadata --no-deps --format-version 1 | jq -r '"homepage=" + .packages[0].homepage' | tee -a $GITHUB_OUTPUT
|
||||||
|
cargo metadata --no-deps --format-version 1 | jq -r '"msrv=" + .packages[0].rust_version' | tee -a $GITHUB_OUTPUT
|
||||||
|
outputs:
|
||||||
|
name: ${{ steps.crate_metadata.outputs.name }}
|
||||||
|
version: ${{ steps.crate_metadata.outputs.version }}
|
||||||
|
maintainer: ${{ steps.crate_metadata.outputs.maintainer }}
|
||||||
|
homepage: ${{ steps.crate_metadata.outputs.homepage }}
|
||||||
|
msrv: ${{ steps.crate_metadata.outputs.msrv }}
|
||||||
|
|
||||||
|
ensure_cargo_fmt:
|
||||||
|
name: Ensure 'cargo fmt' has been run
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
|
with:
|
||||||
|
components: rustfmt
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- run: cargo fmt -- --check
|
||||||
|
|
||||||
|
min_version:
|
||||||
|
name: Minimum supported rust version
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
needs: crate_metadata
|
||||||
|
steps:
|
||||||
|
- name: Checkout source code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Install rust toolchain (v${{ needs.crate_metadata.outputs.msrv }})
|
||||||
|
uses: dtolnay/rust-toolchain@master
|
||||||
|
with:
|
||||||
|
toolchain: ${{ needs.crate_metadata.outputs.msrv }}
|
||||||
|
components: clippy
|
||||||
|
- name: Run clippy (on minimum supported rust version to prevent warnings we can't fix)
|
||||||
|
run: cargo clippy --locked --all-targets ${{ env.MSRV_FEATURES }}
|
||||||
|
- name: Run tests
|
||||||
|
run: cargo test --locked ${{ env.MSRV_FEATURES }}
|
||||||
|
|
||||||
|
build:
|
||||||
|
name: ${{ matrix.job.target }} (${{ matrix.job.os }})
|
||||||
|
runs-on: ${{ matrix.job.os }}
|
||||||
|
needs: crate_metadata
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
job:
|
||||||
|
- { target: aarch64-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true }
|
||||||
|
- { target: arm-unknown-linux-gnueabihf , os: ubuntu-20.04, use-cross: true }
|
||||||
|
- { target: arm-unknown-linux-musleabihf, os: ubuntu-20.04, use-cross: true }
|
||||||
|
- { target: i686-pc-windows-msvc , os: windows-2019 }
|
||||||
|
- { target: i686-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true }
|
||||||
|
- { target: i686-unknown-linux-musl , os: ubuntu-20.04, use-cross: true }
|
||||||
|
- { target: x86_64-apple-darwin , os: macos-12 }
|
||||||
|
- { target: x86_64-pc-windows-gnu , os: windows-2019 }
|
||||||
|
- { target: x86_64-pc-windows-msvc , os: windows-2019 }
|
||||||
|
- { target: x86_64-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true }
|
||||||
|
- { target: x86_64-unknown-linux-musl , os: ubuntu-20.04, use-cross: true }
|
||||||
|
env:
|
||||||
|
BUILD_CMD: cargo
|
||||||
|
steps:
|
||||||
|
- name: Checkout source code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Install prerequisites
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
case ${{ matrix.job.target }} in
|
||||||
|
arm-unknown-linux-*) sudo apt-get -y update ; sudo apt-get -y install gcc-arm-linux-gnueabihf ;;
|
||||||
|
aarch64-unknown-linux-gnu) sudo apt-get -y update ; sudo apt-get -y install gcc-aarch64-linux-gnu ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
- name: Install Rust toolchain
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
with:
|
||||||
|
targets: ${{ matrix.job.target }}
|
||||||
|
|
||||||
|
- name: Install cross
|
||||||
|
if: matrix.job.use-cross
|
||||||
|
uses: taiki-e/install-action@v2
|
||||||
|
with:
|
||||||
|
tool: cross
|
||||||
|
|
||||||
|
- name: Overwrite build command env variable
|
||||||
|
if: matrix.job.use-cross
|
||||||
|
shell: bash
|
||||||
|
run: echo "BUILD_CMD=cross" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Show version information (Rust, cargo, GCC)
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
gcc --version || true
|
||||||
|
rustup -V
|
||||||
|
rustup toolchain list
|
||||||
|
rustup default
|
||||||
|
cargo -V
|
||||||
|
rustc -V
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
shell: bash
|
||||||
|
run: $BUILD_CMD build --locked --release --target=${{ matrix.job.target }}
|
||||||
|
|
||||||
|
- name: Run example
|
||||||
|
if: ${{ !matrix.job.use-cross }}
|
||||||
|
shell: bash
|
||||||
|
run: $BUILD_CMD run --release --target=${{ matrix.job.target }} --example=simple
|
||||||
|
|
||||||
|
- name: Set binary name & path
|
||||||
|
id: bin
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
# Figure out suffix of binary
|
||||||
|
EXE_suffix=""
|
||||||
|
case ${{ matrix.job.target }} in
|
||||||
|
*-pc-windows-*) EXE_suffix=".exe" ;;
|
||||||
|
esac;
|
||||||
|
|
||||||
|
# Setup paths
|
||||||
|
BIN_NAME="${{ needs.crate_metadata.outputs.name }}${EXE_suffix}"
|
||||||
|
BIN_PATH="target/${{ matrix.job.target }}/release/${BIN_NAME}"
|
||||||
|
|
||||||
|
# Let subsequent steps know where to find the binary
|
||||||
|
echo "BIN_PATH=${BIN_PATH}" >> $GITHUB_OUTPUT
|
||||||
|
echo "BIN_NAME=${BIN_NAME}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Set testing options
|
||||||
|
id: test-options
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
# test only library unit tests and binary for arm-type targets
|
||||||
|
unset CARGO_TEST_OPTIONS
|
||||||
|
unset CARGO_TEST_OPTIONS ; case ${{ matrix.job.target }} in arm-* | aarch64-*) CARGO_TEST_OPTIONS="--lib --bin ${{ needs.crate_metadata.outputs.name }}" ;; esac;
|
||||||
|
echo "CARGO_TEST_OPTIONS=${CARGO_TEST_OPTIONS}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
shell: bash
|
||||||
|
run: $BUILD_CMD test --locked --target=${{ matrix.job.target }} ${{ steps.test-options.outputs.CARGO_TEST_OPTIONS}}
|
||||||
|
|
||||||
|
- name: Setup Pandoc
|
||||||
|
uses: r-lib/actions/setup-pandoc@v2
|
||||||
|
|
||||||
|
- name: Generate man page
|
||||||
|
run: pandoc -s -f markdown -t man -o "doc/${{ needs.crate_metadata.outputs.name }}.1" "doc/${{ needs.crate_metadata.outputs.name }}.1.md"
|
||||||
|
|
||||||
|
- name: Create tarball
|
||||||
|
id: package
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
PKG_suffix=".tar.gz" ; case ${{ matrix.job.target }} in *-pc-windows-*) PKG_suffix=".zip" ;; esac;
|
||||||
|
PKG_BASENAME=${{ needs.crate_metadata.outputs.name }}-v${{ needs.crate_metadata.outputs.version }}-${{ matrix.job.target }}
|
||||||
|
PKG_NAME=${PKG_BASENAME}${PKG_suffix}
|
||||||
|
echo "PKG_NAME=${PKG_NAME}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
PKG_STAGING="${{ env.CICD_INTERMEDIATES_DIR }}/package"
|
||||||
|
ARCHIVE_DIR="${PKG_STAGING}/${PKG_BASENAME}/"
|
||||||
|
mkdir -p "${ARCHIVE_DIR}"
|
||||||
|
|
||||||
|
# Binary
|
||||||
|
cp "${{ steps.bin.outputs.BIN_PATH }}" "$ARCHIVE_DIR"
|
||||||
|
|
||||||
|
# README, LICENSE and CHANGELOG files
|
||||||
|
cp "README.md" "LICENSE-MIT" "LICENSE-APACHE" "CHANGELOG.md" "$ARCHIVE_DIR"
|
||||||
|
|
||||||
|
# Man page
|
||||||
|
cp "doc/${{ needs.crate_metadata.outputs.name }}.1" "$ARCHIVE_DIR"
|
||||||
|
|
||||||
|
# base compressed package
|
||||||
|
pushd "${PKG_STAGING}/" >/dev/null
|
||||||
|
case ${{ matrix.job.target }} in
|
||||||
|
*-pc-windows-*) 7z -y a "${PKG_NAME}" "${PKG_BASENAME}"/* | tail -2 ;;
|
||||||
|
*) tar czf "${PKG_NAME}" "${PKG_BASENAME}"/* ;;
|
||||||
|
esac;
|
||||||
|
popd >/dev/null
|
||||||
|
|
||||||
|
# Let subsequent steps know where to find the compressed package
|
||||||
|
echo "PKG_PATH=${PKG_STAGING}/${PKG_NAME}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Create Debian package
|
||||||
|
id: debian-package
|
||||||
|
shell: bash
|
||||||
|
if: startsWith(matrix.job.os, 'ubuntu')
|
||||||
|
run: |
|
||||||
|
COPYRIGHT_YEARS="2018 - "$(date "+%Y")
|
||||||
|
DPKG_STAGING="${{ env.CICD_INTERMEDIATES_DIR }}/debian-package"
|
||||||
|
DPKG_DIR="${DPKG_STAGING}/dpkg"
|
||||||
|
mkdir -p "${DPKG_DIR}"
|
||||||
|
|
||||||
|
DPKG_BASENAME=${{ needs.crate_metadata.outputs.name }}
|
||||||
|
DPKG_CONFLICTS=${{ needs.crate_metadata.outputs.name }}-musl
|
||||||
|
case ${{ matrix.job.target }} in *-musl) DPKG_BASENAME=${{ needs.crate_metadata.outputs.name }}-musl ; DPKG_CONFLICTS=${{ needs.crate_metadata.outputs.name }} ;; esac;
|
||||||
|
DPKG_VERSION=${{ needs.crate_metadata.outputs.version }}
|
||||||
|
|
||||||
|
unset DPKG_ARCH
|
||||||
|
case ${{ matrix.job.target }} in
|
||||||
|
aarch64-*-linux-*) DPKG_ARCH=arm64 ;;
|
||||||
|
arm-*-linux-*hf) DPKG_ARCH=armhf ;;
|
||||||
|
i686-*-linux-*) DPKG_ARCH=i686 ;;
|
||||||
|
x86_64-*-linux-*) DPKG_ARCH=amd64 ;;
|
||||||
|
*) DPKG_ARCH=notset ;;
|
||||||
|
esac;
|
||||||
|
|
||||||
|
DPKG_NAME="${DPKG_BASENAME}_${DPKG_VERSION}_${DPKG_ARCH}.deb"
|
||||||
|
echo "DPKG_NAME=${DPKG_NAME}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
# Binary
|
||||||
|
install -Dm755 "${{ steps.bin.outputs.BIN_PATH }}" "${DPKG_DIR}/usr/bin/${{ steps.bin.outputs.BIN_NAME }}"
|
||||||
|
|
||||||
|
# Man page
|
||||||
|
install -Dm644 'doc/${{ needs.crate_metadata.outputs.name }}.1' "${DPKG_DIR}/usr/share/man/man1/${{ needs.crate_metadata.outputs.name }}.1"
|
||||||
|
gzip -n --best "${DPKG_DIR}/usr/share/man/man1/${{ needs.crate_metadata.outputs.name }}.1"
|
||||||
|
|
||||||
|
# README and LICENSE
|
||||||
|
install -Dm644 "README.md" "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/README.md"
|
||||||
|
install -Dm644 "LICENSE-MIT" "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/LICENSE-MIT"
|
||||||
|
install -Dm644 "LICENSE-APACHE" "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/LICENSE-APACHE"
|
||||||
|
install -Dm644 "CHANGELOG.md" "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/changelog"
|
||||||
|
gzip -n --best "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/changelog"
|
||||||
|
|
||||||
|
cat > "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/copyright" <<EOF
|
||||||
|
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||||
|
Upstream-Name: ${{ needs.crate_metadata.outputs.name }}
|
||||||
|
Source: ${{ needs.crate_metadata.outputs.homepage }}
|
||||||
|
|
||||||
|
Files: *
|
||||||
|
Copyright: ${{ needs.crate_metadata.outputs.maintainer }}
|
||||||
|
Copyright: $COPYRIGHT_YEARS ${{ needs.crate_metadata.outputs.maintainer }}
|
||||||
|
License: Apache-2.0 or MIT
|
||||||
|
|
||||||
|
License: Apache-2.0
|
||||||
|
On Debian systems, the complete text of the Apache-2.0 can be found in the
|
||||||
|
file /usr/share/common-licenses/Apache-2.0.
|
||||||
|
|
||||||
|
License: MIT
|
||||||
|
Permission is hereby granted, free of charge, to any
|
||||||
|
person obtaining a copy of this software and associated
|
||||||
|
documentation files (the "Software"), to deal in the
|
||||||
|
Software without restriction, including without
|
||||||
|
limitation the rights to use, copy, modify, merge,
|
||||||
|
publish, distribute, sublicense, and/or sell copies of
|
||||||
|
the Software, and to permit persons to whom the Software
|
||||||
|
is furnished to do so, subject to the following
|
||||||
|
conditions:
|
||||||
|
.
|
||||||
|
The above copyright notice and this permission notice
|
||||||
|
shall be included in all copies or substantial portions
|
||||||
|
of the Software.
|
||||||
|
.
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
||||||
|
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
||||||
|
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
||||||
|
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||||
|
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
||||||
|
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
DEALINGS IN THE SOFTWARE.
|
||||||
|
EOF
|
||||||
|
chmod 644 "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/copyright"
|
||||||
|
|
||||||
|
# control file
|
||||||
|
mkdir -p "${DPKG_DIR}/DEBIAN"
|
||||||
|
cat > "${DPKG_DIR}/DEBIAN/control" <<EOF
|
||||||
|
Package: ${DPKG_BASENAME}
|
||||||
|
Version: ${DPKG_VERSION}
|
||||||
|
Section: utils
|
||||||
|
Priority: optional
|
||||||
|
Maintainer: ${{ needs.crate_metadata.outputs.maintainer }}
|
||||||
|
Homepage: ${{ needs.crate_metadata.outputs.homepage }}
|
||||||
|
Architecture: ${DPKG_ARCH}
|
||||||
|
Provides: ${{ needs.crate_metadata.outputs.name }}
|
||||||
|
Conflicts: ${DPKG_CONFLICTS}
|
||||||
|
Description: A command-line benchmarking tool
|
||||||
|
EOF
|
||||||
|
|
||||||
|
DPKG_PATH="${DPKG_STAGING}/${DPKG_NAME}"
|
||||||
|
echo "DPKG_PATH=${DPKG_PATH}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
# build dpkg
|
||||||
|
fakeroot dpkg-deb --build "${DPKG_DIR}" "${DPKG_PATH}"
|
||||||
|
|
||||||
|
- name: "Artifact upload: tarball"
|
||||||
|
uses: actions/upload-artifact@master
|
||||||
|
with:
|
||||||
|
name: ${{ steps.package.outputs.PKG_NAME }}
|
||||||
|
path: ${{ steps.package.outputs.PKG_PATH }}
|
||||||
|
|
||||||
|
- name: "Artifact upload: Debian package"
|
||||||
|
uses: actions/upload-artifact@master
|
||||||
|
if: steps.debian-package.outputs.DPKG_NAME
|
||||||
|
with:
|
||||||
|
name: ${{ steps.debian-package.outputs.DPKG_NAME }}
|
||||||
|
path: ${{ steps.debian-package.outputs.DPKG_PATH }}
|
||||||
|
|
||||||
|
- name: Check for release
|
||||||
|
id: is-release
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
unset IS_RELEASE ; if [[ $GITHUB_REF =~ ^refs/tags/v[0-9].* ]]; then IS_RELEASE='true' ; fi
|
||||||
|
echo "IS_RELEASE=${IS_RELEASE}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Publish archives and packages
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
if: steps.is-release.outputs.IS_RELEASE
|
||||||
|
with:
|
||||||
|
files: |
|
||||||
|
${{ steps.package.outputs.PKG_PATH }}
|
||||||
|
${{ steps.debian-package.outputs.DPKG_PATH }}
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@@ -1,2 +1,5 @@
|
|||||||
/target
|
/target
|
||||||
**/*.rs.bk
|
**/*.rs.bk
|
||||||
|
|
||||||
|
# Generated files
|
||||||
|
hexyl.1
|
||||||
-80
@@ -1,80 +0,0 @@
|
|||||||
language: rust
|
|
||||||
cache: cargo
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
# Stable channel.
|
|
||||||
- os: linux
|
|
||||||
rust: stable
|
|
||||||
env: TARGET=x86_64-unknown-linux-gnu
|
|
||||||
- os: linux
|
|
||||||
rust: stable
|
|
||||||
env: TARGET=x86_64-unknown-linux-musl
|
|
||||||
- os: osx
|
|
||||||
rust: stable
|
|
||||||
env: TARGET=x86_64-apple-darwin
|
|
||||||
- os: windows
|
|
||||||
rust: stable
|
|
||||||
env: TARGET=x86_64-pc-windows-gnu
|
|
||||||
|
|
||||||
# Minimum Rust supported channel.
|
|
||||||
- os: linux
|
|
||||||
rust: 1.36.0
|
|
||||||
env: TARGET=x86_64-unknown-linux-gnu
|
|
||||||
|
|
||||||
|
|
||||||
addons:
|
|
||||||
apt:
|
|
||||||
packages:
|
|
||||||
# needed to build deb packages
|
|
||||||
- fakeroot
|
|
||||||
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
# Default target on travis-ci.
|
|
||||||
# Used as conditional check in the install stage
|
|
||||||
- HOST=x86_64-unknown-linux-gnu
|
|
||||||
# Used on the deployment script
|
|
||||||
- PROJECT_NAME=hexyl
|
|
||||||
|
|
||||||
install:
|
|
||||||
# prevent target re-add error from rustup
|
|
||||||
- if [[ $TRAVIS_OS_NAME = linux && $HOST != $TARGET ]]; then rustup target add $TARGET; fi
|
|
||||||
|
|
||||||
script:
|
|
||||||
# Incorporate TARGET env var to the build and test process
|
|
||||||
- cargo build --target $TARGET --verbose
|
|
||||||
- cargo test --target $TARGET --verbose
|
|
||||||
- cargo run --target $TARGET --example=simple
|
|
||||||
|
|
||||||
before_deploy:
|
|
||||||
- bash ci/before_deploy.bash
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
provider: releases
|
|
||||||
# NOTE updating the `api_key.secure`
|
|
||||||
# - go to: https://github.com/settings/tokens/new
|
|
||||||
# - generate new token using `public_repo` scope
|
|
||||||
# - encrypt it using: `travis encrypt API_KEY_HERE`
|
|
||||||
# - paste the output below
|
|
||||||
api_key:
|
|
||||||
secure: "XHpyp21JUWI6GkV7APTwPZiJQJkRJ13E/9VALuWvDrNYF00OE8m+T0ZbG+N1WCuwewa2QQChqd5yBDlwJn+LlDPqstie69xjCt7PEhvI5ERZlbT8KUtMLI4bFIudsaa6LS6phWi/6aKb4cfn0nEYmWhpqfVfsn4Hh4F9OyOFSRmMSSXziU3kxLdIBBO4jOfoDYz+4KUX48CtIhmFy6dSb4G22jzVXL3ixGq895lVFlUzfiGJhHXoS+6KsOx1q0eIEMPC6V0VTT1loBNxKpjBPQ1b0KysCim/jRnr9mB3ko/4yWcMtIvCaZxTaQXWsQn9wAEN62x3ruKugZh3LJbtaxSvnH9PMntXZliz1HJw3Hpmn+tGLxAOm+uwHRz2C/T2ibemgmw6F8KjsjdNv7Nc2//ErIbmMvV4OlJjJI2Q3LWjnYa2gqI0L0sMqUz9HAfiY/BXLSxp19LgSvZPuHNVzMfh9ovF+Rdk1I3TyoByS8ZUi2ngnra8bSjmjtWHmkntOksjWNG6iobpjz9UxdWXPWxNJHQbRfEyTJSISpClykcSZWj+E2+tfuB3YvuRUaVOIhA3THdOSsqEesl3jkUeIhQqgRhE+Uq/XqB7MdfZ9ZTX8ZgfGFL0gjygviuWznTb0q5i4t1SgEJ2ie+ykjVyqQWa0dePtaQp8yx2PtzchJs="
|
|
||||||
# for uploading multiple files
|
|
||||||
file_glob: true
|
|
||||||
# NOTE explanation on each env variable
|
|
||||||
# - PROJECT_NAME: name of the project, set on the `env.global` above
|
|
||||||
# - TRAVIS_TAG: tag name that the build is being deployed for, usually the version number
|
|
||||||
# - TARGET: target triple of the build
|
|
||||||
file:
|
|
||||||
- $PROJECT_NAME-$TRAVIS_TAG-$TARGET.*
|
|
||||||
- $PROJECT_NAME*.deb
|
|
||||||
# don't delete artifacts from previous stage
|
|
||||||
skip_cleanup: true
|
|
||||||
on:
|
|
||||||
# deploy only if we push a tag
|
|
||||||
tags: true
|
|
||||||
# deploy only on stable channel that has TARGET env variable sets
|
|
||||||
condition: $TRAVIS_RUST_VERSION = stable && $TARGET != "x86_64-pc-windows-gnu"
|
|
||||||
|
|
||||||
notifications:
|
|
||||||
email:
|
|
||||||
on_success: never
|
|
||||||
+117
-2
@@ -1,3 +1,111 @@
|
|||||||
|
# v0.13.1
|
||||||
|
|
||||||
|
## Bugfixes
|
||||||
|
|
||||||
|
- Correctly handle discontinuous input (stdin), see #196 and #197 (@sharifhsn)
|
||||||
|
|
||||||
|
# v0.13.0
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Support both little and big Endian dumps using `--endianness={little,big}`, see #189 and #104 (@RinHizakura)
|
||||||
|
|
||||||
|
## Changes
|
||||||
|
|
||||||
|
- **Breaking**: Changed the meaning of the short flag `-C` to be consistent with `hexdump -C`. Previously, this would *hide* the character panel, but now `-C` *shows* the character panel, in case it has been previously (e.g. in an `alias`) disabled with `--no-characters`, see #187 (@sharkdp)
|
||||||
|
|
||||||
|
## `hexyl` as a library
|
||||||
|
|
||||||
|
- New `endianness` method for `PrinterBuilder`
|
||||||
|
|
||||||
|
|
||||||
|
# v0.12.0
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Only show one panel by default if the terminal width is not wide enough for two panels, see #182 (@sharkdp)
|
||||||
|
- Respect the `NO_COLOR` environment variable, see #179 (@sharifhsn)
|
||||||
|
|
||||||
|
## Bugfixes
|
||||||
|
|
||||||
|
- Do not fail with an error if `--panels=auto` is used and the output is piped, see #184 (@sharkdp)
|
||||||
|
|
||||||
|
## Changes
|
||||||
|
|
||||||
|
- Breaking: For `xxd`-compatibility reasons, `--group_bytes` has been renamed to `--group-size` (with an `--groupsize` alias), see #121 (@sharkdp)
|
||||||
|
|
||||||
|
## `hexyl` as a library
|
||||||
|
|
||||||
|
- Breaking: `num_group_bytes` has been renamed to `group_size`.
|
||||||
|
|
||||||
|
|
||||||
|
# v0.11.0
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Significantly improved performance, see #173 and #176 (@sharifhsn)
|
||||||
|
- Added variable panels through the `--panels` and `--terminal-width` flags, see [#13](https://github.com/sharkdp/hexyl/issues/13) and [#164](https://github.com/sharkdp/hexyl/pull/164) (@sharifhsn)
|
||||||
|
- Added new `--group-bytes`/`-g` option, see #104 and #170 (@RinHizakura)
|
||||||
|
- Added new `--base B` option (where `B` can be `binary`, `octal`, `decimal` or `hexadecimal`), see #147 and #178 (@sharifhsn)
|
||||||
|
- Show actual zero bytes as `⋄` in the character panel (previously: `0`), in order not to confuse them with ASCII
|
||||||
|
`0` bytes if colors are deactivated. Closes #166 (@sharkdp)
|
||||||
|
|
||||||
|
## `hexyl` as a library
|
||||||
|
|
||||||
|
- Breaking change: `Printer::new` is deprecated as a part of the public API. Alternatively, you can now construct a `Printer` using the `PrinterBuilder` builder API, see [#168](https://github.com/sharkdp/hexyl/pull/168). (@sharifhsn)
|
||||||
|
|
||||||
|
## Other
|
||||||
|
|
||||||
|
- More tests for the squeezing feature, see #177 (@mkatychev)
|
||||||
|
|
||||||
|
## Thank you
|
||||||
|
|
||||||
|
Special thanks go to @sharifhsn, not just for the new features,
|
||||||
|
bugfixes and performance improvements. But also for many internal
|
||||||
|
improvements of the code base and other maintenance tasks.
|
||||||
|
|
||||||
|
|
||||||
|
# v0.10.0
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Added new `--plain`, `--no-characters`, and `--no-position` flags, see #154 (@mkatychev)
|
||||||
|
- Allow hex numbers and units for `--block-size` argument, see #111 and #144 (@merkrafter)
|
||||||
|
|
||||||
|
## Other
|
||||||
|
|
||||||
|
- Added a man page, see #151 (@sorairolake)
|
||||||
|
- Mention ability to specify length in hex, see #143 (@merkrafter)
|
||||||
|
- `--length` and `--bytes` are now marked as conflicting command-line options, see #152 (@sorairolake)
|
||||||
|
|
||||||
|
|
||||||
|
# v0.9.0
|
||||||
|
|
||||||
|
## Changes
|
||||||
|
|
||||||
|
- Breaking change (binary): setting the `-o/--display-offset` flag no longer overrides the value set by `--skip` [#115](https://github.com/sharkdp/hexyl/issues/115). The first displayed address is now the sum of the two values - this matches the behaviour of `xxd`.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Allow relative and negative byte offsets (e.g. `hexyl --skip=-1block`), see #99 (@ErichDonGubler)
|
||||||
|
- Added `-l` as another alias for '-n/--length' (`xxd` compatibility), see #121 and #135 (@TheDoctor314)
|
||||||
|
|
||||||
|
## Bugfixes
|
||||||
|
|
||||||
|
- Argument `--length` silently takes precedence over `--bytes`, see #105
|
||||||
|
- Print warning on empty content, see #107 and #108
|
||||||
|
- Disallow block sizes of zero, see #110
|
||||||
|
- Fix newline appearing in `--version` output, see #131 and #133 (@scimas)
|
||||||
|
|
||||||
|
## Other
|
||||||
|
|
||||||
|
- Better diagnostic messages, see #98 (@ErichDonGubler)
|
||||||
|
|
||||||
|
## Packaging
|
||||||
|
|
||||||
|
- `hexyl` is now available on snapstore, see #116 (@purveshpatel511)
|
||||||
|
|
||||||
|
|
||||||
# v0.8.0
|
# v0.8.0
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
@@ -24,17 +132,19 @@
|
|||||||
|
|
||||||
- `hexyl` is now available on Void Linux, see #91 (@notramo)
|
- `hexyl` is now available on Void Linux, see #91 (@notramo)
|
||||||
|
|
||||||
|
|
||||||
# v0.7.0
|
# v0.7.0
|
||||||
|
|
||||||
## Bugfixes
|
## Bugfixes
|
||||||
|
|
||||||
- hexyl can now be closed with `Ctrl-C` when reading input from STDIN, see #84
|
- hexyl can now be closed with `Ctrl-C` when reading input from STDIN, see #84
|
||||||
|
|
||||||
## Changes
|
## Changes
|
||||||
|
|
||||||
- Breaking change (library): [`Printer::print_all`](https://docs.rs/hexyl/latest/hexyl/struct.Printer.html#method.print_all) does not take a second argument anymore.
|
- Breaking change (library): [`Printer::print_all`](https://docs.rs/hexyl/latest/hexyl/struct.Printer.html#method.print_all) does not take a second argument anymore.
|
||||||
- Added an example on how to use `hexyl` as a library: https://github.com/sharkdp/hexyl/blob/v0.7.0/examples/simple.rs
|
- Added an example on how to use `hexyl` as a library: https://github.com/sharkdp/hexyl/blob/v0.7.0/examples/simple.rs
|
||||||
|
|
||||||
|
|
||||||
# v0.6.0
|
# v0.6.0
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
@@ -52,6 +162,7 @@
|
|||||||
|
|
||||||
- Performance improvements, see #73 and #66
|
- Performance improvements, see #73 and #66
|
||||||
|
|
||||||
|
|
||||||
# v0.5.1
|
# v0.5.1
|
||||||
|
|
||||||
## Bugfixes
|
## Bugfixes
|
||||||
@@ -60,11 +171,12 @@
|
|||||||
- Some colors are printed even if they're disabled, see #64 (@awidegreen)
|
- Some colors are printed even if they're disabled, see #64 (@awidegreen)
|
||||||
- Fixed build failure on OpenBSD 6.5, see #61
|
- Fixed build failure on OpenBSD 6.5, see #61
|
||||||
|
|
||||||
|
|
||||||
# v0.5.0
|
# v0.5.0
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Added support for squeezing where reoccuring lines are squashed together and visualized with an asterisk. A new `-v`/`--no-squeezing` option can be used to disable the feature. For details, see #59 (@awidegreen)
|
- Added support for squeezing where reoccurring lines are squashed together and visualized with an asterisk. A new `-v`/`--no-squeezing` option can be used to disable the feature. For details, see #59 (@awidegreen)
|
||||||
- Added a new `--border` option with support for various styles (Unicode, ASCII, None), see #54 (@dmke)
|
- Added a new `--border` option with support for various styles (Unicode, ASCII, None), see #54 (@dmke)
|
||||||
- The `--length`/`-n` argument can be passed as a hexadecimal number (`hexyl -n 0xff /dev/urandom`), see #45 (@Qyriad)
|
- The `--length`/`-n` argument can be passed as a hexadecimal number (`hexyl -n 0xff /dev/urandom`), see #45 (@Qyriad)
|
||||||
- Added `--bytes`/`-c` as an alias for `--length`/`-n`, see #48 (@selfup)
|
- Added `--bytes`/`-c` as an alias for `--length`/`-n`, see #48 (@selfup)
|
||||||
@@ -91,16 +203,19 @@
|
|||||||
- Proper Ctrl-C handling, see #35
|
- Proper Ctrl-C handling, see #35
|
||||||
- Proper handling of broken pipes (`hexyl … | head`)
|
- Proper handling of broken pipes (`hexyl … | head`)
|
||||||
|
|
||||||
|
|
||||||
# v0.3.1
|
# v0.3.1
|
||||||
|
|
||||||
- Various (huge) performance improvements, see #23 and #24 (@kballard)
|
- Various (huge) performance improvements, see #23 and #24 (@kballard)
|
||||||
- Replaced 24-bit truecolor ANSI codes by 8-bit codes to support
|
- Replaced 24-bit truecolor ANSI codes by 8-bit codes to support
|
||||||
more terminal emulators, fixes #9
|
more terminal emulators, fixes #9
|
||||||
|
|
||||||
|
|
||||||
# v0.3.0
|
# v0.3.0
|
||||||
|
|
||||||
Windows support
|
Windows support
|
||||||
|
|
||||||
|
|
||||||
# v0.2.0
|
# v0.2.0
|
||||||
|
|
||||||
Initial release
|
Initial release
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
# Contributing
|
||||||
|
|
||||||
|
Thank you for considering to contribute to `hexyl`!
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Add an entry to the changelog
|
||||||
|
|
||||||
|
If your contribution changes the behavior of `hexyl` (as opposed to a typo-fix
|
||||||
|
in the documentation), please update the [`CHANGELOG.md`](CHANGELOG.md) file
|
||||||
|
and describe your changes. This makes the release process much easier and
|
||||||
|
therefore helps to get your changes into a new `hexyl` release faster.
|
||||||
|
|
||||||
|
The top of the `CHANGELOG` contains a *"unreleased"* section with a few
|
||||||
|
subsections (Features, Bugfixes, …). Please add your entry to the subsection
|
||||||
|
that best describes your change
|
||||||
|
|
||||||
|
Entries follow this format:
|
||||||
|
```
|
||||||
|
- Short description of what has been changed, see #123 (@user)
|
||||||
|
```
|
||||||
|
Here, `#123` is the number of the original issue and/or your pull request.
|
||||||
|
Please replace `@user` by your GitHub username.
|
||||||
|
|
||||||
|
|
||||||
|
## Adding a new feature
|
||||||
|
|
||||||
|
Please consider opening a [ticket](https://github.com/sharkdp/hexyl/issues/new)
|
||||||
|
first in order to give us a chance to discuss the feature first.
|
||||||
Generated
+566
-74
@@ -1,139 +1,631 @@
|
|||||||
# This file is automatically @generated by Cargo.
|
# This file is automatically @generated by Cargo.
|
||||||
# It is not intended for manual editing.
|
# It is not intended for manual editing.
|
||||||
|
version = 3
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ansi_term"
|
name = "aho-corasick"
|
||||||
version = "0.11.0"
|
version = "1.0.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"memchr",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ansi_term"
|
name = "anstream"
|
||||||
version = "0.12.1"
|
version = "0.3.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"anstyle",
|
||||||
|
"anstyle-parse",
|
||||||
|
"anstyle-query",
|
||||||
|
"anstyle-wincon",
|
||||||
|
"colorchoice",
|
||||||
|
"is-terminal",
|
||||||
|
"utf8parse",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "atty"
|
name = "anstyle"
|
||||||
version = "0.2.14"
|
version = "1.0.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "anstyle-parse"
|
||||||
|
version = "0.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"hermit-abi 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
"utf8parse",
|
||||||
"libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "anstyle-query"
|
||||||
|
version = "1.0.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b"
|
||||||
|
dependencies = [
|
||||||
|
"windows-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "anstyle-wincon"
|
||||||
|
version = "1.0.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188"
|
||||||
|
dependencies = [
|
||||||
|
"anstyle",
|
||||||
|
"windows-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "anyhow"
|
||||||
|
version = "1.0.72"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "assert_cmd"
|
||||||
|
version = "2.0.12"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "88903cb14723e4d4003335bb7f8a14f27691649105346a0f0957466c096adfe6"
|
||||||
|
dependencies = [
|
||||||
|
"anstyle",
|
||||||
|
"bstr",
|
||||||
|
"doc-comment",
|
||||||
|
"predicates 3.0.3",
|
||||||
|
"predicates-core",
|
||||||
|
"predicates-tree",
|
||||||
|
"wait-timeout",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "autocfg"
|
||||||
|
version = "1.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bitflags"
|
name = "bitflags"
|
||||||
version = "1.2.1"
|
version = "1.3.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bitflags"
|
||||||
|
version = "2.3.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bstr"
|
||||||
|
version = "1.6.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05"
|
||||||
|
dependencies = [
|
||||||
|
"memchr",
|
||||||
|
"regex-automata",
|
||||||
|
"serde",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cc"
|
||||||
|
version = "1.0.79"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap"
|
name = "clap"
|
||||||
version = "2.33.1"
|
version = "4.3.19"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5fd304a20bff958a57f04c4e96a2e7594cc4490a0e809cbd48bb6437edaa452d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"clap_builder",
|
||||||
"atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
]
|
||||||
"bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
"strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
[[package]]
|
||||||
"term_size 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
name = "clap_builder"
|
||||||
"textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
version = "4.3.19"
|
||||||
"unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
"vec_map 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
checksum = "01c6a3f08f1fe5662a35cfe393aec09c4df95f60ee93b7556505260f75eee9e1"
|
||||||
|
dependencies = [
|
||||||
|
"anstream",
|
||||||
|
"anstyle",
|
||||||
|
"clap_lex",
|
||||||
|
"once_cell",
|
||||||
|
"strsim",
|
||||||
|
"terminal_size",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "clap_lex"
|
||||||
|
version = "0.5.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "colorchoice"
|
||||||
|
version = "1.0.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "const_format"
|
||||||
|
version = "0.2.31"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c990efc7a285731f9a4378d81aff2f0e85a2c8781a05ef0f8baa8dac54d0ff48"
|
||||||
|
dependencies = [
|
||||||
|
"const_format_proc_macros",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "const_format_proc_macros"
|
||||||
|
version = "0.2.31"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e026b6ce194a874cb9cf32cd5772d1ef9767cc8fcb5765948d74f37a9d8b2bf6"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"unicode-xid",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "diff"
|
||||||
|
version = "0.1.13"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "difflib"
|
||||||
|
version = "0.4.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "doc-comment"
|
||||||
|
version = "0.3.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "either"
|
||||||
|
version = "1.9.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "errno"
|
||||||
|
version = "0.3.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a"
|
||||||
|
dependencies = [
|
||||||
|
"errno-dragonfly",
|
||||||
|
"libc",
|
||||||
|
"windows-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "errno-dragonfly"
|
||||||
|
version = "0.1.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf"
|
||||||
|
dependencies = [
|
||||||
|
"cc",
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "float-cmp"
|
||||||
|
version = "0.9.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4"
|
||||||
|
dependencies = [
|
||||||
|
"num-traits",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hermit-abi"
|
name = "hermit-abi"
|
||||||
version = "0.1.13"
|
version = "0.3.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b"
|
||||||
"libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hexyl"
|
name = "hexyl"
|
||||||
version = "0.8.0"
|
version = "0.13.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ansi_term 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"anyhow",
|
||||||
"atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
"assert_cmd",
|
||||||
"clap 2.33.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"clap",
|
||||||
"libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)",
|
"const_format",
|
||||||
|
"libc",
|
||||||
|
"owo-colors",
|
||||||
|
"predicates 2.1.5",
|
||||||
|
"pretty_assertions",
|
||||||
|
"supports-color",
|
||||||
|
"terminal_size",
|
||||||
|
"thiserror",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "io-lifetimes"
|
||||||
|
version = "1.0.11"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2"
|
||||||
|
dependencies = [
|
||||||
|
"hermit-abi",
|
||||||
|
"libc",
|
||||||
|
"windows-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "is-terminal"
|
||||||
|
version = "0.4.9"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b"
|
||||||
|
dependencies = [
|
||||||
|
"hermit-abi",
|
||||||
|
"rustix 0.38.4",
|
||||||
|
"windows-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "is_ci"
|
||||||
|
version = "1.1.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "616cde7c720bb2bb5824a224687d8f77bfd38922027f01d825cd7453be5099fb"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "itertools"
|
||||||
|
version = "0.10.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473"
|
||||||
|
dependencies = [
|
||||||
|
"either",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.71"
|
version = "0.2.147"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "linux-raw-sys"
|
||||||
|
version = "0.3.8"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "linux-raw-sys"
|
||||||
|
version = "0.4.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "memchr"
|
||||||
|
version = "2.5.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "normalize-line-endings"
|
||||||
|
version = "0.3.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "num-traits"
|
||||||
|
version = "0.2.16"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2"
|
||||||
|
dependencies = [
|
||||||
|
"autocfg",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "once_cell"
|
||||||
|
version = "1.18.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "owo-colors"
|
||||||
|
version = "3.5.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "predicates"
|
||||||
|
version = "2.1.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd"
|
||||||
|
dependencies = [
|
||||||
|
"difflib",
|
||||||
|
"float-cmp",
|
||||||
|
"itertools",
|
||||||
|
"normalize-line-endings",
|
||||||
|
"predicates-core",
|
||||||
|
"regex",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "predicates"
|
||||||
|
version = "3.0.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "09963355b9f467184c04017ced4a2ba2d75cbcb4e7462690d388233253d4b1a9"
|
||||||
|
dependencies = [
|
||||||
|
"anstyle",
|
||||||
|
"difflib",
|
||||||
|
"itertools",
|
||||||
|
"predicates-core",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "predicates-core"
|
||||||
|
version = "1.0.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "predicates-tree"
|
||||||
|
version = "1.0.9"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "368ba315fb8c5052ab692e68a0eefec6ec57b23a36959c14496f0b0df2c0cecf"
|
||||||
|
dependencies = [
|
||||||
|
"predicates-core",
|
||||||
|
"termtree",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pretty_assertions"
|
||||||
|
version = "1.4.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66"
|
||||||
|
dependencies = [
|
||||||
|
"diff",
|
||||||
|
"yansi",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "proc-macro2"
|
||||||
|
version = "1.0.66"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9"
|
||||||
|
dependencies = [
|
||||||
|
"unicode-ident",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "quote"
|
||||||
|
version = "1.0.32"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "regex"
|
||||||
|
version = "1.9.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575"
|
||||||
|
dependencies = [
|
||||||
|
"aho-corasick",
|
||||||
|
"memchr",
|
||||||
|
"regex-automata",
|
||||||
|
"regex-syntax",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "regex-automata"
|
||||||
|
version = "0.3.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310"
|
||||||
|
dependencies = [
|
||||||
|
"aho-corasick",
|
||||||
|
"memchr",
|
||||||
|
"regex-syntax",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "regex-syntax"
|
||||||
|
version = "0.7.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rustix"
|
||||||
|
version = "0.37.23"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags 1.3.2",
|
||||||
|
"errno",
|
||||||
|
"io-lifetimes",
|
||||||
|
"libc",
|
||||||
|
"linux-raw-sys 0.3.8",
|
||||||
|
"windows-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rustix"
|
||||||
|
version = "0.38.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags 2.3.3",
|
||||||
|
"errno",
|
||||||
|
"libc",
|
||||||
|
"linux-raw-sys 0.4.3",
|
||||||
|
"windows-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "serde"
|
||||||
|
version = "1.0.175"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5d25439cd7397d044e2748a6fe2432b5e85db703d6d097bd014b3c0ad1ebff0b"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "strsim"
|
name = "strsim"
|
||||||
version = "0.8.0"
|
version = "0.10.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "term_size"
|
name = "supports-color"
|
||||||
version = "0.3.2"
|
version = "2.0.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4950e7174bffabe99455511c39707310e7e9b440364a2fcb1cc21521be57b354"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)",
|
"is-terminal",
|
||||||
"winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
"is_ci",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "textwrap"
|
name = "syn"
|
||||||
version = "0.11.0"
|
version = "2.0.27"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b60f673f44a8255b9c8c657daf66a596d435f2da81a555b06dc644d080ba45e0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"term_size 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"proc-macro2",
|
||||||
"unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
"quote",
|
||||||
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-width"
|
name = "terminal_size"
|
||||||
version = "0.1.7"
|
version = "0.2.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "vec_map"
|
|
||||||
version = "0.8.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "winapi"
|
|
||||||
version = "0.3.8"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8e6bf6f19e9f8ed8d4048dc22981458ebcf406d67e94cd422e5ecd73d63b3237"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"rustix 0.37.23",
|
||||||
"winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"windows-sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "winapi-i686-pc-windows-gnu"
|
name = "termtree"
|
||||||
version = "0.4.0"
|
version = "0.4.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "winapi-x86_64-pc-windows-gnu"
|
name = "thiserror"
|
||||||
version = "0.4.0"
|
version = "1.0.44"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90"
|
||||||
|
dependencies = [
|
||||||
|
"thiserror-impl",
|
||||||
|
]
|
||||||
|
|
||||||
[metadata]
|
[[package]]
|
||||||
"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
|
name = "thiserror-impl"
|
||||||
"checksum ansi_term 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2"
|
version = "1.0.44"
|
||||||
"checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
|
checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96"
|
||||||
"checksum clap 2.33.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bdfa80d47f954d53a35a64987ca1422f495b8d6483c0fe9f7117b36c2a792129"
|
dependencies = [
|
||||||
"checksum hermit-abi 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "91780f809e750b0a89f5544be56617ff6b1227ee485bcb06ebe10cdf89bd3b71"
|
"proc-macro2",
|
||||||
"checksum libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)" = "9457b06509d27052635f90d6466700c65095fdf75409b3fbdd903e988b886f49"
|
"quote",
|
||||||
"checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
|
"syn",
|
||||||
"checksum term_size 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1e4129646ca0ed8f45d09b929036bafad5377103edd06e50bf574b353d2b08d9"
|
]
|
||||||
"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
|
|
||||||
"checksum unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479"
|
[[package]]
|
||||||
"checksum vec_map 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
|
name = "unicode-ident"
|
||||||
"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6"
|
version = "1.0.11"
|
||||||
"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicode-xid"
|
||||||
|
version = "0.2.4"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "utf8parse"
|
||||||
|
version = "0.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wait-timeout"
|
||||||
|
version = "0.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-sys"
|
||||||
|
version = "0.48.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
|
||||||
|
dependencies = [
|
||||||
|
"windows-targets",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-targets"
|
||||||
|
version = "0.48.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f"
|
||||||
|
dependencies = [
|
||||||
|
"windows_aarch64_gnullvm",
|
||||||
|
"windows_aarch64_msvc",
|
||||||
|
"windows_i686_gnu",
|
||||||
|
"windows_i686_msvc",
|
||||||
|
"windows_x86_64_gnu",
|
||||||
|
"windows_x86_64_gnullvm",
|
||||||
|
"windows_x86_64_msvc",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_aarch64_gnullvm"
|
||||||
|
version = "0.48.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_aarch64_msvc"
|
||||||
|
version = "0.48.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_i686_gnu"
|
||||||
|
version = "0.48.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_i686_msvc"
|
||||||
|
version = "0.48.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_x86_64_gnu"
|
||||||
|
version = "0.48.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_x86_64_gnullvm"
|
||||||
|
version = "0.48.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows_x86_64_msvc"
|
||||||
|
version = "0.48.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "yansi"
|
||||||
|
version = "0.5.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec"
|
||||||
+17
-6
@@ -7,17 +7,28 @@ license = "MIT/Apache-2.0"
|
|||||||
name = "hexyl"
|
name = "hexyl"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
repository = "https://github.com/sharkdp/hexyl"
|
repository = "https://github.com/sharkdp/hexyl"
|
||||||
version = "0.8.0"
|
version = "0.13.1"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
|
rust-version = "1.66"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
ansi_term = "0.12"
|
anyhow = "1.0"
|
||||||
atty = "0.2"
|
const_format = "0.2"
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
|
owo-colors = "3"
|
||||||
|
supports-color = "2"
|
||||||
|
thiserror = "1.0"
|
||||||
|
terminal_size = "0.2"
|
||||||
|
|
||||||
[dependencies.clap]
|
[dependencies.clap]
|
||||||
version = "2"
|
version = "4"
|
||||||
features = ["suggestions", "color", "wrap_help"]
|
default-features = false
|
||||||
|
features = ["std", "suggestions", "color", "wrap_help", "cargo", "help", "usage", "error-context"]
|
||||||
|
|
||||||
|
[dev-dependencies]
|
||||||
|
assert_cmd = "2.0"
|
||||||
|
predicates = "2.0"
|
||||||
|
pretty_assertions = "1.3.0"
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
lto = true
|
lto = true
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||

|

|
||||||
|
|
||||||
[](https://travis-ci.org/sharkdp/hexyl)
|
[](https://github.com/sharkdp/hexyl/actions/workflows/CICD.yml)
|
||||||
[](https://crates.io/crates/hexyl)
|
[](https://crates.io/crates/hexyl)
|
||||||

|

|
||||||
|
|
||||||
@@ -17,13 +17,27 @@ of bytes (NULL bytes, printable ASCII characters, ASCII whitespace characters, o
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
## Color Reference
|
||||||
|
|
||||||
|
|Type of Byte|Color|ANSI Code |
|
||||||
|
|---|---|---|
|
||||||
|
|NULL| Bright Black|90|
|
||||||
|
|OFFSET| Bright Black|90|
|
||||||
|
|ASCII Printable| Cyan|36|
|
||||||
|
|ASCII Whitespace| Green|32|
|
||||||
|
|ASCII Other| Green|32|
|
||||||
|
|Non-ASCII| Yellow|33|
|
||||||
|
|
||||||
|
*Colors taken from the Ubuntu terminal color scheme, they could look different in your terminal*
|
||||||
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
### On Ubuntu
|
### On Ubuntu
|
||||||
|
|
||||||
*... and other Debian-based Linux distributions.*
|
*... and other Debian-based Linux distributions.*
|
||||||
|
|
||||||
If you run Ubuntu 19.10 (Eoan Ermine) or newer, you can install the [officially maintained package](https://packages.ubuntu.com/eoan/hexyl):
|
If you run Ubuntu 19.10 (Eoan Ermine) or newer, you can install the [officially maintained package](https://packages.ubuntu.com/search?keywords=hexyl):
|
||||||
```bash
|
```bash
|
||||||
sudo apt install hexyl
|
sudo apt install hexyl
|
||||||
```
|
```
|
||||||
@@ -31,12 +45,12 @@ If you use an older version of Ubuntu, you can download
|
|||||||
the latest `.deb` package from the release page and install it via:
|
the latest `.deb` package from the release page and install it via:
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
sudo dpkg -i hexyl_0.7.0_amd64.deb # adapt version number and architecture
|
sudo dpkg -i hexyl_0.13.1_amd64.deb # adapt version number and architecture
|
||||||
```
|
```
|
||||||
|
|
||||||
### On Debian
|
### On Debian
|
||||||
|
|
||||||
If you run Debian Buster or newer, you can install the [officially maintained Debian package](https://packages.debian.org/buster/hexyl):
|
If you run Debian Buster or newer, you can install the [officially maintained Debian package](https://packages.debian.org/search?searchon=names&keywords=hexyl):
|
||||||
```bash
|
```bash
|
||||||
sudo apt-get install hexyl
|
sudo apt-get install hexyl
|
||||||
```
|
```
|
||||||
@@ -44,6 +58,14 @@ sudo apt-get install hexyl
|
|||||||
If you run an older version of Debian, see above for instructions on how to
|
If you run an older version of Debian, see above for instructions on how to
|
||||||
manually install `hexyl`.
|
manually install `hexyl`.
|
||||||
|
|
||||||
|
### On Fedora
|
||||||
|
|
||||||
|
If you run Fedora 35 or newer, you can install the [officially maintained Fedora package](https://packages.fedoraproject.org/pkgs/rust-hexyl/hexyl):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo dnf install hexyl
|
||||||
|
```
|
||||||
|
|
||||||
### On Arch Linux
|
### On Arch Linux
|
||||||
|
|
||||||
You can install `hexyl` from [the official package repository](https://www.archlinux.org/packages/community/x86_64/hexyl/):
|
You can install `hexyl` from [the official package repository](https://www.archlinux.org/packages/community/x86_64/hexyl/):
|
||||||
@@ -53,50 +75,114 @@ pacman -S hexyl
|
|||||||
```
|
```
|
||||||
|
|
||||||
### On Void Linux
|
### On Void Linux
|
||||||
|
|
||||||
```
|
```
|
||||||
xbps-install hexyl
|
xbps-install hexyl
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### On Gentoo Linux
|
||||||
|
|
||||||
|
Available in [dm9pZCAq overlay](https://github.com/gentoo-mirror/dm9pZCAq)
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo eselect repository enable dm9pZCAq
|
||||||
|
sudo emerge --sync dm9pZCAq
|
||||||
|
sudo emerge sys-apps/hexyl::dm9pZCAq
|
||||||
|
```
|
||||||
|
|
||||||
### On macOS
|
### On macOS
|
||||||
|
|
||||||
|
Via [Homebrew](https://brew.sh):
|
||||||
|
|
||||||
```
|
```
|
||||||
brew install hexyl
|
brew install hexyl
|
||||||
```
|
```
|
||||||
|
|
||||||
|
...or via [MacPorts](https://www.macports.org):
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo port install hexyl
|
||||||
|
```
|
||||||
|
|
||||||
### On FreeBSD
|
### On FreeBSD
|
||||||
|
|
||||||
```
|
```
|
||||||
pkg install hexyl
|
pkg install hexyl
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### on Termux
|
||||||
|
```
|
||||||
|
pkg install hexyl
|
||||||
|
```
|
||||||
|
or
|
||||||
|
```
|
||||||
|
apt install hexyl
|
||||||
|
```
|
||||||
|
|
||||||
### Via Nix
|
### Via Nix
|
||||||
|
|
||||||
```
|
```
|
||||||
nix-env -i hexyl
|
nix-env -i hexyl
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Via Guix
|
||||||
|
|
||||||
|
```
|
||||||
|
guix package -i hexyl
|
||||||
|
```
|
||||||
|
|
||||||
|
Or add the `hexyl` package in the list of packages to be installed in your system configuration (e.g., `/etc/config.scm`).
|
||||||
|
|
||||||
### On other distributions
|
### On other distributions
|
||||||
|
|
||||||
Check out the [release page](https://github.com/sharkdp/hexyl/releases) for binary builds.
|
Check out the [release page](https://github.com/sharkdp/hexyl/releases) for binary builds.
|
||||||
|
|
||||||
### On Windows
|
### On Windows
|
||||||
|
|
||||||
For now, you will have to install from source via `cargo` (see below). Make sure that you
|
Check out the [release page](https://github.com/sharkdp/hexyl/releases) for binary builds.
|
||||||
use a terminal that supports ANSI escape sequences (like ConHost v2 since Windows 10 1703
|
Alternatively, install from source via `cargo`, `snap` or `scoop` (see below).
|
||||||
|
Make sure that you use a terminal that supports ANSI escape sequences (like ConHost v2 since Windows 10 1703
|
||||||
or Windows Terminal since Windows 10 1903).
|
or Windows Terminal since Windows 10 1903).
|
||||||
|
|
||||||
### Via cargo
|
### Via cargo
|
||||||
|
|
||||||
If you have Rust 1.36 or higher, you can install `hexyl` from source via `cargo`:
|
If you have Rust 1.56 or higher, you can install `hexyl` from source via `cargo`:
|
||||||
```
|
```
|
||||||
cargo install hexyl
|
cargo install hexyl
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Alternatively, you can install `hexyl` directly from the repository by using:
|
||||||
|
```
|
||||||
|
git clone https://github.com/sharkdp/hexyl
|
||||||
|
cargo install --path ./hexyl
|
||||||
|
```
|
||||||
|
|
||||||
|
Note: To convert the man page, you will need [Pandoc](https://pandoc.org/).
|
||||||
|
|
||||||
|
You can convert from Markdown by using (in the project root):
|
||||||
|
```
|
||||||
|
pandoc -s -f markdown -t man -o ./doc/hexyl.1 ./doc/hexyl.1.md
|
||||||
|
```
|
||||||
|
|
||||||
|
### Via snap package
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo snap install hexyl
|
||||||
|
```
|
||||||
|
[Get it from the Snap Store](https://snapcraft.io/hexyl)
|
||||||
|
|
||||||
|
|
||||||
|
### Via [Scoop](https://scoop.sh)
|
||||||
|
```
|
||||||
|
scoop install hexyl
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Licensed under either of
|
Licensed under either of
|
||||||
|
|
||||||
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
|
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0)
|
||||||
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
|
* MIT license ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT)
|
||||||
|
|
||||||
at your option.
|
at your option.
|
||||||
@@ -1 +0,0 @@
|
|||||||
*.bash linguist-vendored
|
|
||||||
@@ -1,103 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# Building and packaging for release
|
|
||||||
|
|
||||||
set -ex
|
|
||||||
|
|
||||||
build() {
|
|
||||||
cargo build --target "$TARGET" --release --verbose
|
|
||||||
}
|
|
||||||
|
|
||||||
pack() {
|
|
||||||
local tempdir
|
|
||||||
local out_dir
|
|
||||||
local package_name
|
|
||||||
|
|
||||||
tempdir=$(mktemp -d 2>/dev/null || mktemp -d -t tmp)
|
|
||||||
out_dir=$(pwd)
|
|
||||||
package_name="$PROJECT_NAME-$TRAVIS_TAG-$TARGET"
|
|
||||||
|
|
||||||
# create a "staging" directory
|
|
||||||
mkdir "$tempdir/$package_name"
|
|
||||||
|
|
||||||
# copying the main binary
|
|
||||||
cp "target/$TARGET/release/$PROJECT_NAME" "$tempdir/$package_name/"
|
|
||||||
strip "$tempdir/$package_name/$PROJECT_NAME"
|
|
||||||
|
|
||||||
# readme and license
|
|
||||||
cp README.md "$tempdir/$package_name"
|
|
||||||
cp LICENSE-MIT "$tempdir/$package_name"
|
|
||||||
cp LICENSE-APACHE "$tempdir/$package_name"
|
|
||||||
|
|
||||||
# archiving
|
|
||||||
pushd "$tempdir"
|
|
||||||
tar czf "$out_dir/$package_name.tar.gz" "$package_name"/*
|
|
||||||
popd
|
|
||||||
rm -r "$tempdir"
|
|
||||||
}
|
|
||||||
|
|
||||||
make_deb() {
|
|
||||||
local tempdir
|
|
||||||
local architecture
|
|
||||||
local version
|
|
||||||
local dpkgname
|
|
||||||
local conflictname
|
|
||||||
|
|
||||||
case $TARGET in
|
|
||||||
x86_64*)
|
|
||||||
architecture=amd64
|
|
||||||
;;
|
|
||||||
i686*)
|
|
||||||
architecture=i386
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "ERROR: unknown target" >&2
|
|
||||||
return 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
version=${TRAVIS_TAG#v}
|
|
||||||
if [[ $TARGET = *musl* ]]; then
|
|
||||||
dpkgname=$PROJECT_NAME-musl
|
|
||||||
conflictname=$PROJECT_NAME
|
|
||||||
else
|
|
||||||
dpkgname=$PROJECT_NAME
|
|
||||||
conflictname=$PROJECT_NAME-musl
|
|
||||||
fi
|
|
||||||
|
|
||||||
tempdir=$(mktemp -d 2>/dev/null || mktemp -d -t tmp)
|
|
||||||
|
|
||||||
# copy the main binary
|
|
||||||
install -Dm755 "target/$TARGET/release/$PROJECT_NAME" "$tempdir/usr/bin/$PROJECT_NAME"
|
|
||||||
strip "$tempdir/usr/bin/$PROJECT_NAME"
|
|
||||||
|
|
||||||
# readme and license
|
|
||||||
install -Dm644 README.md "$tempdir/usr/share/doc/$PROJECT_NAME/README.md"
|
|
||||||
install -Dm644 LICENSE-MIT "$tempdir/usr/share/doc/$PROJECT_NAME/LICENSE-MIT"
|
|
||||||
install -Dm644 LICENSE-APACHE "$tempdir/usr/share/doc/$PROJECT_NAME/LICENSE-APACHE"
|
|
||||||
|
|
||||||
# Control file
|
|
||||||
mkdir "$tempdir/DEBIAN"
|
|
||||||
cat > "$tempdir/DEBIAN/control" <<EOF
|
|
||||||
Package: $dpkgname
|
|
||||||
Version: $version
|
|
||||||
Section: utils
|
|
||||||
Priority: optional
|
|
||||||
Maintainer: David Peter <mail@david-peter.de>
|
|
||||||
Architecture: $architecture
|
|
||||||
Provides: $PROJECT_NAME
|
|
||||||
Conflicts: $conflictname
|
|
||||||
Description: A command-line hex viewer.
|
|
||||||
EOF
|
|
||||||
|
|
||||||
fakeroot dpkg-deb --build "$tempdir" "${dpkgname}_${version}_${architecture}.deb"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
main() {
|
|
||||||
build
|
|
||||||
pack
|
|
||||||
if [[ $TARGET = *linux* ]]; then
|
|
||||||
make_deb
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
main
|
|
||||||
+148
@@ -0,0 +1,148 @@
|
|||||||
|
% HEXYL(1) hexyl 0.12.0 | General Commands Manual
|
||||||
|
%
|
||||||
|
% 2022-12-05
|
||||||
|
|
||||||
|
<!--
|
||||||
|
This man page is written in Pandoc's Markdown.
|
||||||
|
See: https://pandoc.org/MANUAL.html#pandocs-markdown
|
||||||
|
-->
|
||||||
|
|
||||||
|
# NAME
|
||||||
|
|
||||||
|
hexyl - a command-line hex viewer
|
||||||
|
|
||||||
|
# SYNOPSIS
|
||||||
|
|
||||||
|
**hexyl** [_OPTIONS_] [_FILE_]
|
||||||
|
|
||||||
|
# DESCRIPTION
|
||||||
|
|
||||||
|
**hexyl** is a simple hex viewer for the terminal.
|
||||||
|
It uses a colored output to distinguish different categories of bytes (NULL
|
||||||
|
bytes, printable ASCII characters, ASCII whitespace characters, other ASCII
|
||||||
|
characters and non-ASCII).
|
||||||
|
|
||||||
|
# POSITIONAL ARGUMENTS
|
||||||
|
|
||||||
|
_FILE_
|
||||||
|
: The file to display.
|
||||||
|
If no _FILE_ argument is given, read from STDIN.
|
||||||
|
|
||||||
|
# OPTIONS
|
||||||
|
|
||||||
|
**-n**, **\--length** _N_
|
||||||
|
: Only read _N_ bytes from the input.
|
||||||
|
The _N_ argument can also include a unit with a decimal prefix (kB, MB, ..)
|
||||||
|
or binary prefix (kiB, MiB, ..), or can be specified using a hex number.
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
|
||||||
|
:
|
||||||
|
|
||||||
|
Read the first 64 bytes:
|
||||||
|
: $ **hexyl \--length=64**
|
||||||
|
|
||||||
|
Read the first 4 kibibytes:
|
||||||
|
: $ **hexyl \--length=4KiB**
|
||||||
|
|
||||||
|
Read the first 255 bytes (specified using a hex number):
|
||||||
|
: $ **hexyl \--length=0xff**
|
||||||
|
|
||||||
|
**-c**, **\--bytes** _N_
|
||||||
|
: An alias for **-n**/**\--length**.
|
||||||
|
|
||||||
|
**-l** _N_
|
||||||
|
: Yet another alias for **-n**/**\--length**.
|
||||||
|
|
||||||
|
**-s**, **\--skip** _N_
|
||||||
|
: Skip the first _N_ bytes of the input.
|
||||||
|
The _N_ argument can also include a unit (see **\--length** for details).
|
||||||
|
A negative value is valid and will seek from the end of the file.
|
||||||
|
|
||||||
|
**\--block-size** _SIZE_
|
||||||
|
: Sets the size of the block unit to _SIZE_ (default is 512).
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
|
||||||
|
:
|
||||||
|
|
||||||
|
Sets the block size to 1024 bytes:
|
||||||
|
: $ **hexyl \--block-size=1024 \--length=5block**
|
||||||
|
|
||||||
|
Sets the block size to 4 kilobytes:
|
||||||
|
: $ **hexyl \--block-size=4kB \--length=2block**
|
||||||
|
|
||||||
|
**-v**, **\--no-squeezing**
|
||||||
|
: Displays all input data.
|
||||||
|
Otherwise any number of groups of output lines which would be identical to
|
||||||
|
the preceding group of lines, are replaced with a line comprised of a
|
||||||
|
single asterisk.
|
||||||
|
|
||||||
|
**\--color** _WHEN_
|
||||||
|
: When to use colors.
|
||||||
|
The auto-mode only displays colors if the output goes to an interactive
|
||||||
|
terminal.
|
||||||
|
|
||||||
|
Possible values:
|
||||||
|
|
||||||
|
: - **always** (default)
|
||||||
|
- **auto**
|
||||||
|
- **never**
|
||||||
|
|
||||||
|
**\--border** _STYLE_
|
||||||
|
: Whether to draw a border with Unicode characters, ASCII characters, or none
|
||||||
|
at all.
|
||||||
|
|
||||||
|
Possible values:
|
||||||
|
|
||||||
|
: - **unicode** (default)
|
||||||
|
- **ascii**
|
||||||
|
- **none**
|
||||||
|
|
||||||
|
**-o**, **\--display-offset** _N_
|
||||||
|
: Add _N_ bytes to the displayed file position.
|
||||||
|
The _N_ argument can also include a unit (see **\--length** for details).
|
||||||
|
A negative value is valid and calculates an offset relative to the end of
|
||||||
|
the file.
|
||||||
|
|
||||||
|
**-h**, **\--help**
|
||||||
|
: Prints help information.
|
||||||
|
|
||||||
|
**-V**, **\--version**
|
||||||
|
: Prints version information.
|
||||||
|
|
||||||
|
# NOTES
|
||||||
|
|
||||||
|
Source repository:
|
||||||
|
: <https://github.com/sharkdp/hexyl>
|
||||||
|
|
||||||
|
# EXAMPLES
|
||||||
|
|
||||||
|
Print a given file:
|
||||||
|
: $ **hexyl small.png**
|
||||||
|
|
||||||
|
Print and view a given file in the terminal pager:
|
||||||
|
: $ **hexyl big.png | less -r**
|
||||||
|
|
||||||
|
Print the first 256 bytes of a given special file:
|
||||||
|
: $ **hexyl -n 256 /dev/urandom**
|
||||||
|
|
||||||
|
# AUTHORS
|
||||||
|
|
||||||
|
**hexyl** was written by David Peter <mail@david-peter.de>.
|
||||||
|
|
||||||
|
# REPORTING BUGS
|
||||||
|
|
||||||
|
Bugs can be reported on GitHub at:
|
||||||
|
: <https://github.com/sharkdp/hexyl/issues>
|
||||||
|
|
||||||
|
# COPYRIGHT
|
||||||
|
|
||||||
|
**hexyl** is dual-licensed under:
|
||||||
|
|
||||||
|
: - Apache License 2.0 (<https://www.apache.org/licenses/LICENSE-2.0>)
|
||||||
|
- MIT License (<https://opensource.org/licenses/MIT>)
|
||||||
|
|
||||||
|
# SEE ALSO
|
||||||
|
|
||||||
|
**hexdump**(1), **xxd**(1)
|
||||||
+10
-6
@@ -1,6 +1,6 @@
|
|||||||
use std::io;
|
use std::io;
|
||||||
|
|
||||||
use hexyl::{BorderStyle, Printer};
|
use hexyl::{BorderStyle, PrinterBuilder};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let input = vec![
|
let input = vec![
|
||||||
@@ -11,10 +11,14 @@ fn main() {
|
|||||||
let stdout = io::stdout();
|
let stdout = io::stdout();
|
||||||
let mut handle = stdout.lock();
|
let mut handle = stdout.lock();
|
||||||
|
|
||||||
let show_color = true;
|
let mut printer = PrinterBuilder::new(&mut handle)
|
||||||
let use_squeezing = false;
|
.show_color(true)
|
||||||
let border_style = BorderStyle::Unicode;
|
.show_char_panel(true)
|
||||||
|
.show_position_panel(true)
|
||||||
let mut printer = Printer::new(&mut handle, show_color, border_style, use_squeezing);
|
.with_border_style(BorderStyle::Unicode)
|
||||||
|
.enable_squeezing(false)
|
||||||
|
.num_panels(2)
|
||||||
|
.group_size(1)
|
||||||
|
.build();
|
||||||
printer.print_all(&input[..]).unwrap();
|
printer.print_all(&input[..]).unwrap();
|
||||||
}
|
}
|
||||||
+754
-184
File diff suppressed because it is too large.
Load diff
+644
-254
File diff suppressed because it is too large.
Load diff
-425
@@ -1,425 +0,0 @@
|
|||||||
#[derive(Debug, PartialEq)]
|
|
||||||
enum SqueezeState {
|
|
||||||
/// not enabled
|
|
||||||
Disabled,
|
|
||||||
/// Will be set from all states if equal condition can't be hold up.
|
|
||||||
/// Set if previous byte is not equal the current processed byte.
|
|
||||||
NoSqueeze,
|
|
||||||
/// Valid for a whole line to identify if it is candidate for squeezing
|
|
||||||
Probe,
|
|
||||||
/// Squeeze line parsing is active, but EOL is not reached yet
|
|
||||||
SqueezeActive,
|
|
||||||
/// Squeeze line, EOL is reached, will influence the action
|
|
||||||
Squeeze,
|
|
||||||
/// same as Squeeze, however this is only for the first line after
|
|
||||||
/// the squeeze candidate has been set.
|
|
||||||
SqueezeFirstLine,
|
|
||||||
/// same as SqueezeActive, however this is only for the first line after
|
|
||||||
/// the squeeze candidate has been set.
|
|
||||||
SqueezeActiveFirstLine,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct Squeezer {
|
|
||||||
state: SqueezeState,
|
|
||||||
byte: u8,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
|
||||||
pub enum SqueezeAction {
|
|
||||||
Ignore,
|
|
||||||
Print,
|
|
||||||
Delete,
|
|
||||||
}
|
|
||||||
|
|
||||||
/// line size
|
|
||||||
const LSIZE: u64 = 16;
|
|
||||||
|
|
||||||
impl Squeezer {
|
|
||||||
pub fn new(enabled: bool) -> Squeezer {
|
|
||||||
Squeezer {
|
|
||||||
state: if enabled {
|
|
||||||
SqueezeState::Probe
|
|
||||||
} else {
|
|
||||||
SqueezeState::Disabled
|
|
||||||
},
|
|
||||||
byte: 0,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn process(&mut self, b: u8, i: u64) {
|
|
||||||
use self::SqueezeState::*;
|
|
||||||
if self.state == Disabled {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let eq = b == self.byte;
|
|
||||||
|
|
||||||
if i % LSIZE == 0 {
|
|
||||||
if !eq {
|
|
||||||
self.state = Probe;
|
|
||||||
} else {
|
|
||||||
self.state = match self.state {
|
|
||||||
NoSqueeze => Probe,
|
|
||||||
Probe => SqueezeActiveFirstLine,
|
|
||||||
SqueezeActiveFirstLine => SqueezeFirstLine,
|
|
||||||
SqueezeFirstLine => SqueezeActive,
|
|
||||||
SqueezeActive => Squeeze,
|
|
||||||
Squeeze => SqueezeActive,
|
|
||||||
Disabled => Disabled,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
} else if !eq {
|
|
||||||
if i % LSIZE == 1 {
|
|
||||||
self.state = Probe;
|
|
||||||
} else if i % LSIZE != 1 {
|
|
||||||
self.state = NoSqueeze;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
self.byte = b;
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn active(&self) -> bool {
|
|
||||||
use self::SqueezeState::*;
|
|
||||||
match self.state {
|
|
||||||
Squeeze | SqueezeActive | SqueezeFirstLine | SqueezeActiveFirstLine => true,
|
|
||||||
_ => false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn action(&self) -> SqueezeAction {
|
|
||||||
match self.state {
|
|
||||||
SqueezeState::SqueezeFirstLine => SqueezeAction::Print,
|
|
||||||
SqueezeState::Squeeze => SqueezeAction::Delete,
|
|
||||||
_ => SqueezeAction::Ignore,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn advance(&mut self) {
|
|
||||||
match self.state {
|
|
||||||
SqueezeState::SqueezeFirstLine => {
|
|
||||||
self.state = SqueezeState::SqueezeActive;
|
|
||||||
}
|
|
||||||
SqueezeState::Squeeze => {
|
|
||||||
self.state = SqueezeState::SqueezeActive;
|
|
||||||
}
|
|
||||||
_ => {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
mod tests {
|
|
||||||
use super::*;
|
|
||||||
|
|
||||||
const LSIZE_USIZE: usize = LSIZE as usize;
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn three_same_lines() {
|
|
||||||
const LINES: usize = 3;
|
|
||||||
let v = vec![0u8; LINES * LSIZE_USIZE];
|
|
||||||
let mut s = Squeezer::new(true);
|
|
||||||
// just initialized
|
|
||||||
assert_eq!(s.action(), SqueezeAction::Ignore);
|
|
||||||
s.advance();
|
|
||||||
|
|
||||||
let exp = vec![
|
|
||||||
SqueezeAction::Ignore, // first line, print as is
|
|
||||||
SqueezeAction::Print, // print squeeze symbol
|
|
||||||
SqueezeAction::Delete, // delete reoccurring line
|
|
||||||
];
|
|
||||||
|
|
||||||
let mut line = 0;
|
|
||||||
let mut idx = 1;
|
|
||||||
for z in v.chunks(LSIZE_USIZE) {
|
|
||||||
for i in z {
|
|
||||||
s.process(*i, idx);
|
|
||||||
idx += 1;
|
|
||||||
}
|
|
||||||
let action = s.action();
|
|
||||||
s.advance();
|
|
||||||
assert_eq!(action, exp[line]);
|
|
||||||
line += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn incomplete_while_squeeze() {
|
|
||||||
// fourth line only has 12 bytes and should be printed
|
|
||||||
let v = vec![0u8; 3 * LSIZE_USIZE + 12];
|
|
||||||
let mut s = Squeezer::new(true);
|
|
||||||
// just initialized
|
|
||||||
assert_eq!(s.action(), SqueezeAction::Ignore);
|
|
||||||
s.advance();
|
|
||||||
|
|
||||||
let exp = vec![
|
|
||||||
SqueezeAction::Ignore, // first line, print as is
|
|
||||||
SqueezeAction::Print, // print squeeze symbol
|
|
||||||
SqueezeAction::Delete, // delete reoccurring line
|
|
||||||
SqueezeAction::Ignore, // last line only 12 bytes, print it
|
|
||||||
];
|
|
||||||
|
|
||||||
let mut line = 0;
|
|
||||||
let mut idx = 1;
|
|
||||||
for z in v.chunks(LSIZE_USIZE) {
|
|
||||||
for i in z {
|
|
||||||
s.process(*i, idx);
|
|
||||||
idx += 1;
|
|
||||||
}
|
|
||||||
assert_eq!(s.action(), exp[line]);
|
|
||||||
s.advance();
|
|
||||||
line += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
/// all three lines are different, print all
|
|
||||||
fn three_different_lines() {
|
|
||||||
let mut v: Vec<u8> = vec![];
|
|
||||||
v.extend(vec![0u8; 16]);
|
|
||||||
v.extend(vec![1u8; 16]);
|
|
||||||
v.extend(vec![2u8; 16]);
|
|
||||||
|
|
||||||
let mut s = Squeezer::new(true);
|
|
||||||
// just initialized
|
|
||||||
assert_eq!(s.action(), SqueezeAction::Ignore);
|
|
||||||
s.advance();
|
|
||||||
|
|
||||||
let exp = vec![
|
|
||||||
SqueezeAction::Ignore, // first line, print as is
|
|
||||||
SqueezeAction::Ignore, // different
|
|
||||||
SqueezeAction::Ignore, // different
|
|
||||||
];
|
|
||||||
|
|
||||||
let mut line = 0;
|
|
||||||
let mut idx = 1;
|
|
||||||
for z in v.chunks(LSIZE_USIZE) {
|
|
||||||
for i in z {
|
|
||||||
s.process(*i, idx);
|
|
||||||
idx += 1;
|
|
||||||
}
|
|
||||||
let action = s.action();
|
|
||||||
assert_eq!(action, exp[line]);
|
|
||||||
s.advance();
|
|
||||||
line += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
/// first two lines same, hence squeeze symbol, third line diff, hence
|
|
||||||
/// print
|
|
||||||
fn one_squeeze_no_delete() {
|
|
||||||
const LINES: usize = 3;
|
|
||||||
let mut v = vec![0u8; (LINES - 1) * LSIZE_USIZE];
|
|
||||||
v.extend(vec![1u8; 16]);
|
|
||||||
|
|
||||||
let mut s = Squeezer::new(true);
|
|
||||||
// just initialized
|
|
||||||
assert_eq!(s.action(), SqueezeAction::Ignore);
|
|
||||||
s.advance();
|
|
||||||
|
|
||||||
let exp = vec![
|
|
||||||
SqueezeAction::Ignore, // first line, print as is
|
|
||||||
SqueezeAction::Print, // print squeeze symbol
|
|
||||||
SqueezeAction::Ignore, // different lines, print again
|
|
||||||
];
|
|
||||||
|
|
||||||
let mut line = 0;
|
|
||||||
let mut idx = 1;
|
|
||||||
for z in v.chunks(LSIZE_USIZE) {
|
|
||||||
for i in z {
|
|
||||||
s.process(*i, idx);
|
|
||||||
idx += 1;
|
|
||||||
}
|
|
||||||
let action = s.action();
|
|
||||||
s.advance();
|
|
||||||
assert_eq!(action, exp[line]);
|
|
||||||
line += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
/// First line all eq, 2nd half eq with first line, then change
|
|
||||||
fn second_line_different() {
|
|
||||||
const LINES: usize = 2;
|
|
||||||
let mut v = vec![0u8; (LINES - 1) * LSIZE_USIZE];
|
|
||||||
v.extend(vec![0u8; 8]);
|
|
||||||
v.extend(vec![1u8; 8]);
|
|
||||||
|
|
||||||
let mut s = Squeezer::new(true);
|
|
||||||
// just initialized
|
|
||||||
assert_eq!(s.action(), SqueezeAction::Ignore);
|
|
||||||
s.advance();
|
|
||||||
|
|
||||||
let exp = vec![
|
|
||||||
SqueezeAction::Ignore, // first line, print as is
|
|
||||||
SqueezeAction::Ignore, // print squeeze symbol
|
|
||||||
];
|
|
||||||
|
|
||||||
let mut line = 0;
|
|
||||||
let mut idx = 1;
|
|
||||||
for z in v.chunks(LSIZE_USIZE) {
|
|
||||||
for i in z {
|
|
||||||
s.process(*i, idx);
|
|
||||||
idx += 1;
|
|
||||||
}
|
|
||||||
let action = s.action();
|
|
||||||
s.advance();
|
|
||||||
assert_eq!(action, exp[line]);
|
|
||||||
line += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
/// all three lines never become squeeze candidate (diff within line)
|
|
||||||
fn never_squeeze_candidate() {
|
|
||||||
let mut v = vec![];
|
|
||||||
v.extend(vec![0u8; 8]);
|
|
||||||
v.extend(vec![1u8; 8]);
|
|
||||||
v.extend(vec![0u8; 8]);
|
|
||||||
v.extend(vec![1u8; 8]);
|
|
||||||
v.extend(vec![0u8; 8]);
|
|
||||||
v.extend(vec![1u8; 8]);
|
|
||||||
|
|
||||||
let mut s = Squeezer::new(true);
|
|
||||||
// just initialized
|
|
||||||
assert_eq!(s.action(), SqueezeAction::Ignore);
|
|
||||||
s.advance();
|
|
||||||
|
|
||||||
let exp = vec![
|
|
||||||
SqueezeAction::Ignore, // first line, print as is
|
|
||||||
SqueezeAction::Ignore, // print squeeze symbol
|
|
||||||
SqueezeAction::Ignore, // print squeeze symbol
|
|
||||||
];
|
|
||||||
|
|
||||||
let mut line = 0;
|
|
||||||
let mut idx = 1;
|
|
||||||
for z in v.chunks(LSIZE_USIZE) {
|
|
||||||
for i in z {
|
|
||||||
s.process(*i, idx);
|
|
||||||
idx += 1;
|
|
||||||
}
|
|
||||||
let action = s.action();
|
|
||||||
s.advance();
|
|
||||||
assert_eq!(action, exp[line]);
|
|
||||||
line += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn mix_everything() {
|
|
||||||
let mut v = vec![];
|
|
||||||
v.extend(vec![10u8; 16]); // print
|
|
||||||
v.extend(vec![20u8; 16]); // print
|
|
||||||
v.extend(vec![0u8; 16]); // print
|
|
||||||
v.extend(vec![0u8; 16]); // *
|
|
||||||
v.extend(vec![10u8; 16]); // print
|
|
||||||
v.extend(vec![20u8; 16]); // print
|
|
||||||
v.extend(vec![0u8; 16]); // print
|
|
||||||
v.extend(vec![0u8; 16]); // *
|
|
||||||
v.extend(vec![0u8; 16]); // delete
|
|
||||||
v.extend(vec![0u8; 16]); // delete*
|
|
||||||
v.extend(vec![20u8; 16]); // print
|
|
||||||
v.extend(vec![0u8; 12]); // print, only 12 bytes
|
|
||||||
|
|
||||||
let mut s = Squeezer::new(true);
|
|
||||||
// just initialized
|
|
||||||
assert_eq!(s.action(), SqueezeAction::Ignore);
|
|
||||||
s.advance();
|
|
||||||
|
|
||||||
let exp = vec![
|
|
||||||
SqueezeAction::Ignore,
|
|
||||||
SqueezeAction::Ignore,
|
|
||||||
SqueezeAction::Ignore,
|
|
||||||
SqueezeAction::Print,
|
|
||||||
SqueezeAction::Ignore,
|
|
||||||
SqueezeAction::Ignore,
|
|
||||||
SqueezeAction::Ignore,
|
|
||||||
SqueezeAction::Print,
|
|
||||||
SqueezeAction::Delete,
|
|
||||||
SqueezeAction::Delete,
|
|
||||||
SqueezeAction::Ignore,
|
|
||||||
SqueezeAction::Ignore,
|
|
||||||
];
|
|
||||||
|
|
||||||
let mut line = 0;
|
|
||||||
let mut idx = 1;
|
|
||||||
for z in v.chunks(LSIZE_USIZE) {
|
|
||||||
for i in z {
|
|
||||||
s.process(*i, idx);
|
|
||||||
idx += 1;
|
|
||||||
}
|
|
||||||
let action = s.action();
|
|
||||||
s.advance();
|
|
||||||
assert_eq!(action, exp[line]);
|
|
||||||
line += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn last_char_diff() {
|
|
||||||
// see issue #62
|
|
||||||
let mut v = vec![];
|
|
||||||
v.extend(vec![20u8; 16]);
|
|
||||||
v.extend(vec![20u8; 15]);
|
|
||||||
v.push(61);
|
|
||||||
v.extend(vec![20u8; 16]);
|
|
||||||
v.extend(vec![20u8; 16]);
|
|
||||||
|
|
||||||
let mut s = Squeezer::new(true);
|
|
||||||
// just initialized
|
|
||||||
assert_eq!(s.action(), SqueezeAction::Ignore);
|
|
||||||
s.advance();
|
|
||||||
|
|
||||||
let exp = vec![
|
|
||||||
SqueezeAction::Ignore, // print as is
|
|
||||||
SqueezeAction::Ignore, // print as is
|
|
||||||
SqueezeAction::Ignore, // print as is
|
|
||||||
SqueezeAction::Print, // print '*' char
|
|
||||||
];
|
|
||||||
|
|
||||||
let mut line = 0;
|
|
||||||
let mut idx = 1;
|
|
||||||
for z in v.chunks(LSIZE_USIZE) {
|
|
||||||
for i in z {
|
|
||||||
s.process(*i, idx);
|
|
||||||
idx += 1;
|
|
||||||
}
|
|
||||||
assert_eq!(s.action(), exp[line]);
|
|
||||||
s.advance();
|
|
||||||
line += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn first_char_diff() {
|
|
||||||
// see issue #62
|
|
||||||
let mut v = vec![];
|
|
||||||
v.extend(vec![20u8; 16]);
|
|
||||||
v.push(61);
|
|
||||||
v.extend(vec![20u8; 15]);
|
|
||||||
v.extend(vec![20u8; 16]);
|
|
||||||
|
|
||||||
let mut s = Squeezer::new(true);
|
|
||||||
// just initialized
|
|
||||||
assert_eq!(s.action(), SqueezeAction::Ignore);
|
|
||||||
s.advance();
|
|
||||||
|
|
||||||
let exp = vec![
|
|
||||||
SqueezeAction::Ignore, // print as is
|
|
||||||
SqueezeAction::Ignore, // print as is
|
|
||||||
SqueezeAction::Ignore, // print as is
|
|
||||||
];
|
|
||||||
|
|
||||||
let mut line = 0;
|
|
||||||
let mut idx = 1;
|
|
||||||
for z in v.chunks(LSIZE_USIZE) {
|
|
||||||
for i in z {
|
|
||||||
s.process(*i, idx);
|
|
||||||
idx += 1;
|
|
||||||
}
|
|
||||||
assert_eq!(s.action(), exp[line]);
|
|
||||||
s.advance();
|
|
||||||
line += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ascii text eol=lf
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
0123456789abcde
|
||||||
Whitespace-only changes.
Executable
BIN
Binary file not shown.
@@ -0,0 +1,620 @@
|
|||||||
|
use assert_cmd::Command;
|
||||||
|
|
||||||
|
fn hexyl() -> Command {
|
||||||
|
let mut cmd = Command::cargo_bin("hexyl").unwrap();
|
||||||
|
cmd.current_dir("tests/examples");
|
||||||
|
cmd
|
||||||
|
}
|
||||||
|
trait PrettyAssert<S>
|
||||||
|
where
|
||||||
|
S: AsRef<str>,
|
||||||
|
{
|
||||||
|
fn pretty_stdout(self, other: S);
|
||||||
|
}
|
||||||
|
|
||||||
|
// https://github.com/assert-rs/assert_cmd/issues/121#issuecomment-849937376
|
||||||
|
//
|
||||||
|
impl<S> PrettyAssert<S> for assert_cmd::assert::Assert
|
||||||
|
where
|
||||||
|
S: AsRef<str>,
|
||||||
|
{
|
||||||
|
fn pretty_stdout(self, other: S) {
|
||||||
|
println!("{}", other.as_ref().len());
|
||||||
|
let self_str = String::from_utf8(self.get_output().stdout.clone()).unwrap();
|
||||||
|
println!("{}", self_str.len());
|
||||||
|
pretty_assertions::assert_eq!(self_str, other.as_ref());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mod basic {
|
||||||
|
use super::hexyl;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn can_print_simple_ascii_file() {
|
||||||
|
hexyl()
|
||||||
|
.arg("ascii")
|
||||||
|
.arg("--color=never")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.stdout(
|
||||||
|
"┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐\n\
|
||||||
|
│00000000│ 30 31 32 33 34 35 36 37 ┊ 38 39 61 62 63 64 65 0a │01234567┊89abcde_│\n\
|
||||||
|
└────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘\n",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn can_read_input_from_stdin() {
|
||||||
|
hexyl()
|
||||||
|
.arg("--color=never")
|
||||||
|
.write_stdin("abc")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.stdout(
|
||||||
|
"┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐\n\
|
||||||
|
│00000000│ 61 62 63 ┊ │abc ┊ │\n\
|
||||||
|
└────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘\n",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn fails_on_non_existing_input() {
|
||||||
|
hexyl().arg("non-existing").assert().failure();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn prints_warning_on_empty_content() {
|
||||||
|
hexyl()
|
||||||
|
.arg("empty")
|
||||||
|
.arg("--color=never")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.stdout(
|
||||||
|
"┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐\n\
|
||||||
|
│ │ No content │ │ │ │\n\
|
||||||
|
└────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘\n",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mod length {
|
||||||
|
use super::hexyl;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn length_restricts_output_size() {
|
||||||
|
hexyl()
|
||||||
|
.arg("hello_world_elf64")
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--length=32")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.stdout(
|
||||||
|
"┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐\n\
|
||||||
|
│00000000│ 7f 45 4c 46 02 01 01 00 ┊ 00 00 00 00 00 00 00 00 │•ELF•••⋄┊⋄⋄⋄⋄⋄⋄⋄⋄│\n\
|
||||||
|
│00000010│ 02 00 3e 00 01 00 00 00 ┊ 00 10 40 00 00 00 00 00 │•⋄>⋄•⋄⋄⋄┊⋄•@⋄⋄⋄⋄⋄│\n\
|
||||||
|
└────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘\n",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn fail_if_length_and_bytes_options_are_used_simultaneously() {
|
||||||
|
hexyl()
|
||||||
|
.arg("hello_world_elf64")
|
||||||
|
.arg("--length=32")
|
||||||
|
.arg("--bytes=10")
|
||||||
|
.assert()
|
||||||
|
.failure();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn fail_if_length_and_count_options_are_used_simultaneously() {
|
||||||
|
hexyl()
|
||||||
|
.arg("hello_world_elf64")
|
||||||
|
.arg("--length=32")
|
||||||
|
.arg("-l=10")
|
||||||
|
.assert()
|
||||||
|
.failure();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mod bytes {
|
||||||
|
use super::hexyl;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn fail_if_bytes_and_count_options_are_used_simultaneously() {
|
||||||
|
hexyl()
|
||||||
|
.arg("hello_world_elf64")
|
||||||
|
.arg("--bytes=32")
|
||||||
|
.arg("-l=10")
|
||||||
|
.assert()
|
||||||
|
.failure();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mod skip {
|
||||||
|
use super::hexyl;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn basic() {
|
||||||
|
hexyl()
|
||||||
|
.arg("ascii")
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--skip=2")
|
||||||
|
.arg("--length=4")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.stdout(
|
||||||
|
"┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐\n\
|
||||||
|
│00000002│ 32 33 34 35 ┊ │2345 ┊ │\n\
|
||||||
|
└────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘\n",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn prints_warning_when_skipping_past_the_end() {
|
||||||
|
hexyl()
|
||||||
|
.arg("ascii")
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--skip=1000")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.stdout(
|
||||||
|
"┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐\n\
|
||||||
|
│ │ No content │ │ │ │\n\
|
||||||
|
└────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘\n",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn negative_offset() {
|
||||||
|
hexyl()
|
||||||
|
.arg("ascii")
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--skip=-4")
|
||||||
|
.arg("--length=3")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.stdout(
|
||||||
|
"┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐\n\
|
||||||
|
│0000000c│ 63 64 65 ┊ │cde ┊ │\n\
|
||||||
|
└────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘\n",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn fails_if_negative_offset_is_too_large() {
|
||||||
|
hexyl()
|
||||||
|
.arg("ascii")
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--skip=-1MiB")
|
||||||
|
.assert()
|
||||||
|
.failure()
|
||||||
|
.stderr(predicates::str::contains("Failed to jump"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mod display_offset {
|
||||||
|
use super::hexyl;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn basic() {
|
||||||
|
hexyl()
|
||||||
|
.arg("ascii")
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--display-offset=0xc0ffee")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.stdout(
|
||||||
|
"┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐\n\
|
||||||
|
│00c0ffee│ 30 31 32 33 34 35 36 37 ┊ 38 39 61 62 63 64 65 0a │01234567┊89abcde_│\n\
|
||||||
|
└────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘\n",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn display_offset_and_skip() {
|
||||||
|
hexyl()
|
||||||
|
.arg("hello_world_elf64")
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--display-offset=0x20")
|
||||||
|
.arg("--skip=0x10")
|
||||||
|
.arg("--length=0x10")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.stdout(
|
||||||
|
"┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐\n\
|
||||||
|
│00000030│ 02 00 3e 00 01 00 00 00 ┊ 00 10 40 00 00 00 00 00 │•⋄>⋄•⋄⋄⋄┊⋄•@⋄⋄⋄⋄⋄│\n\
|
||||||
|
└────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘\n",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mod blocksize {
|
||||||
|
use super::hexyl;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn fails_for_zero_or_negative_blocksize() {
|
||||||
|
hexyl()
|
||||||
|
.arg("ascii")
|
||||||
|
.arg("--block-size=0")
|
||||||
|
.assert()
|
||||||
|
.failure();
|
||||||
|
|
||||||
|
hexyl()
|
||||||
|
.arg("ascii")
|
||||||
|
.arg("--block-size=-16")
|
||||||
|
.assert()
|
||||||
|
.failure();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mod display_settings {
|
||||||
|
use super::hexyl;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn plain() {
|
||||||
|
hexyl()
|
||||||
|
.arg("ascii")
|
||||||
|
.arg("--plain")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.stdout(" 30 31 32 33 34 35 36 37 38 39 61 62 63 64 65 0a \n");
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn no_chars() {
|
||||||
|
hexyl()
|
||||||
|
.arg("ascii")
|
||||||
|
.arg("--no-characters")
|
||||||
|
.arg("--color=never")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.stdout(
|
||||||
|
"┌────────┬─────────────────────────┬─────────────────────────┐\n\
|
||||||
|
│00000000│ 30 31 32 33 34 35 36 37 ┊ 38 39 61 62 63 64 65 0a │\n\
|
||||||
|
└────────┴─────────────────────────┴─────────────────────────┘\n",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn no_position() {
|
||||||
|
hexyl()
|
||||||
|
.arg("ascii")
|
||||||
|
.arg("--no-position")
|
||||||
|
.arg("--color=never")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.stdout(
|
||||||
|
"┌─────────────────────────┬─────────────────────────┬────────┬────────┐\n\
|
||||||
|
│ 30 31 32 33 34 35 36 37 ┊ 38 39 61 62 63 64 65 0a │01234567┊89abcde_│\n\
|
||||||
|
└─────────────────────────┴─────────────────────────┴────────┴────────┘\n",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mod group_and_endianness {
|
||||||
|
use super::hexyl;
|
||||||
|
use super::PrettyAssert;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn group_2_bytes_be() {
|
||||||
|
hexyl()
|
||||||
|
.arg("ascii")
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--group-size=2")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.stdout(
|
||||||
|
"┌────────┬─────────────────────┬─────────────────────┬────────┬────────┐\n\
|
||||||
|
│00000000│ 3031 3233 3435 3637 ┊ 3839 6162 6364 650a │01234567┊89abcde_│\n\
|
||||||
|
└────────┴─────────────────────┴─────────────────────┴────────┴────────┘\n",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn group_2_bytes_le() {
|
||||||
|
hexyl()
|
||||||
|
.arg("ascii")
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--group-size=2")
|
||||||
|
.arg("--endianness=little")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.stdout(
|
||||||
|
"┌────────┬─────────────────────┬─────────────────────┬────────┬────────┐\n\
|
||||||
|
│00000000│ 3130 3332 3534 3736 ┊ 3938 6261 6463 0a65 │01234567┊89abcde_│\n\
|
||||||
|
└────────┴─────────────────────┴─────────────────────┴────────┴────────┘\n",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn group_4_bytes_be() {
|
||||||
|
hexyl()
|
||||||
|
.arg("ascii")
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--group-size=4")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.stdout(
|
||||||
|
"┌────────┬───────────────────┬───────────────────┬────────┬────────┐\n\
|
||||||
|
│00000000│ 30313233 34353637 ┊ 38396162 6364650a │01234567┊89abcde_│\n\
|
||||||
|
└────────┴───────────────────┴───────────────────┴────────┴────────┘\n",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn group_4_bytes_le() {
|
||||||
|
hexyl()
|
||||||
|
.arg("ascii")
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--group-size=4")
|
||||||
|
.arg("--endianness=little")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.stdout(
|
||||||
|
"┌────────┬───────────────────┬───────────────────┬────────┬────────┐\n\
|
||||||
|
│00000000│ 33323130 37363534 ┊ 62613938 0a656463 │01234567┊89abcde_│\n\
|
||||||
|
└────────┴───────────────────┴───────────────────┴────────┴────────┘\n",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn group_8_bytes_be() {
|
||||||
|
hexyl()
|
||||||
|
.arg("ascii")
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--group-size=8")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.stdout(
|
||||||
|
"┌────────┬──────────────────┬──────────────────┬────────┬────────┐\n\
|
||||||
|
│00000000│ 3031323334353637 ┊ 383961626364650a │01234567┊89abcde_│\n\
|
||||||
|
└────────┴──────────────────┴──────────────────┴────────┴────────┘\n",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn group_8_bytes_le() {
|
||||||
|
hexyl()
|
||||||
|
.arg("ascii")
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--group-size=8")
|
||||||
|
.arg("--endianness=little")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.stdout(
|
||||||
|
"┌────────┬──────────────────┬──────────────────┬────────┬────────┐\n\
|
||||||
|
│00000000│ 3736353433323130 ┊ 0a65646362613938 │01234567┊89abcde_│\n\
|
||||||
|
└────────┴──────────────────┴──────────────────┴────────┴────────┘\n",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn group_size_plain() {
|
||||||
|
hexyl()
|
||||||
|
.arg("ascii")
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--plain")
|
||||||
|
.arg("--group-size=2")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.stdout(" 3031 3233 3435 3637 3839 6162 6364 650a \n");
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn group_size_fill_space() {
|
||||||
|
hexyl()
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--group-size=2")
|
||||||
|
.write_stdin("abc")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.stdout(
|
||||||
|
"┌────────┬─────────────────────┬─────────────────────┬────────┬────────┐\n\
|
||||||
|
│00000000│ 6162 63 ┊ │abc ┊ │\n\
|
||||||
|
└────────┴─────────────────────┴─────────────────────┴────────┴────────┘\n",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn group_size_invalid() {
|
||||||
|
hexyl()
|
||||||
|
.arg("ascii")
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--plain")
|
||||||
|
.arg("--group-size=3")
|
||||||
|
.assert()
|
||||||
|
.failure();
|
||||||
|
}
|
||||||
|
#[test]
|
||||||
|
fn squeeze_no_chars() {
|
||||||
|
hexyl()
|
||||||
|
.arg("hello_world_elf64")
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--skip=1024")
|
||||||
|
.arg("--length=4096")
|
||||||
|
.arg("--no-characters")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.pretty_stdout(
|
||||||
|
"\
|
||||||
|
┌────────┬─────────────────────────┬─────────────────────────┐
|
||||||
|
│00000400│ 00 00 00 00 00 00 00 00 ┊ 00 00 00 00 00 00 00 00 │
|
||||||
|
│* │ ┊ │
|
||||||
|
│00001000│ ba 0e 00 00 00 b9 00 20 ┊ 40 00 bb 01 00 00 00 b8 │
|
||||||
|
│00001010│ 04 00 00 00 cd 80 b8 01 ┊ 00 00 00 cd 80 00 00 00 │
|
||||||
|
│00001020│ 00 00 00 00 00 00 00 00 ┊ 00 00 00 00 00 00 00 00 │
|
||||||
|
│* │ ┊ │
|
||||||
|
│00001400│ ┊ │
|
||||||
|
└────────┴─────────────────────────┴─────────────────────────┘
|
||||||
|
",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
#[test]
|
||||||
|
fn squeeze_no_chars_one_panel() {
|
||||||
|
hexyl()
|
||||||
|
.arg("hello_world_elf64")
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--skip=1024")
|
||||||
|
.arg("--length=4096")
|
||||||
|
.arg("--no-characters")
|
||||||
|
.arg("--panels=1")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.pretty_stdout(
|
||||||
|
"\
|
||||||
|
┌────────┬─────────────────────────┐
|
||||||
|
│00000400│ 00 00 00 00 00 00 00 00 │
|
||||||
|
│* │ │
|
||||||
|
│00001000│ ba 0e 00 00 00 b9 00 20 │
|
||||||
|
│00001008│ 40 00 bb 01 00 00 00 b8 │
|
||||||
|
│00001010│ 04 00 00 00 cd 80 b8 01 │
|
||||||
|
│00001018│ 00 00 00 cd 80 00 00 00 │
|
||||||
|
│00001020│ 00 00 00 00 00 00 00 00 │
|
||||||
|
│* │ │
|
||||||
|
│00001400│ │
|
||||||
|
└────────┴─────────────────────────┘
|
||||||
|
",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
#[test]
|
||||||
|
fn squeeze_no_position() {
|
||||||
|
hexyl()
|
||||||
|
.arg("hello_world_elf64")
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--skip=1024")
|
||||||
|
.arg("--length=4096")
|
||||||
|
.arg("--no-position")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.pretty_stdout(
|
||||||
|
"\
|
||||||
|
┌─────────────────────────┬─────────────────────────┬────────┬────────┐
|
||||||
|
│ 00 00 00 00 00 00 00 00 ┊ 00 00 00 00 00 00 00 00 │⋄⋄⋄⋄⋄⋄⋄⋄┊⋄⋄⋄⋄⋄⋄⋄⋄│
|
||||||
|
│* ┊ │ ┊ │
|
||||||
|
│ ba 0e 00 00 00 b9 00 20 ┊ 40 00 bb 01 00 00 00 b8 │ו⋄⋄⋄×⋄ ┊@⋄ו⋄⋄⋄×│
|
||||||
|
│ 04 00 00 00 cd 80 b8 01 ┊ 00 00 00 cd 80 00 00 00 │•⋄⋄⋄××ו┊⋄⋄⋄××⋄⋄⋄│
|
||||||
|
│ 00 00 00 00 00 00 00 00 ┊ 00 00 00 00 00 00 00 00 │⋄⋄⋄⋄⋄⋄⋄⋄┊⋄⋄⋄⋄⋄⋄⋄⋄│
|
||||||
|
│* ┊ │ ┊ │
|
||||||
|
│* ┊ │ ┊ │
|
||||||
|
└─────────────────────────┴─────────────────────────┴────────┴────────┘
|
||||||
|
",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
#[test]
|
||||||
|
fn squeeze_no_position_one_panel() {
|
||||||
|
hexyl()
|
||||||
|
.arg("hello_world_elf64")
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--skip=1024")
|
||||||
|
.arg("--length=4096")
|
||||||
|
.arg("--no-position")
|
||||||
|
.arg("--panels=1")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.pretty_stdout(
|
||||||
|
"\
|
||||||
|
┌─────────────────────────┬────────┐
|
||||||
|
│ 00 00 00 00 00 00 00 00 │⋄⋄⋄⋄⋄⋄⋄⋄│
|
||||||
|
│* │ │
|
||||||
|
│ ba 0e 00 00 00 b9 00 20 │ו⋄⋄⋄×⋄ │
|
||||||
|
│ 40 00 bb 01 00 00 00 b8 │@⋄ו⋄⋄⋄×│
|
||||||
|
│ 04 00 00 00 cd 80 b8 01 │•⋄⋄⋄××ו│
|
||||||
|
│ 00 00 00 cd 80 00 00 00 │⋄⋄⋄××⋄⋄⋄│
|
||||||
|
│ 00 00 00 00 00 00 00 00 │⋄⋄⋄⋄⋄⋄⋄⋄│
|
||||||
|
│* │ │
|
||||||
|
│* │ │
|
||||||
|
└─────────────────────────┴────────┘
|
||||||
|
",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
#[test]
|
||||||
|
fn squeeze_odd_panels_remainder_bytes() {
|
||||||
|
hexyl()
|
||||||
|
.arg("hello_world_elf64")
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--skip=1024")
|
||||||
|
.arg("--length=4092") // 4 byte remainder
|
||||||
|
.arg("--panels=3")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.pretty_stdout(
|
||||||
|
"\
|
||||||
|
┌────────┬─────────────────────────┬─────────────────────────┬─────────────────────────┬────────┬────────┬────────┐
|
||||||
|
│00000400│ 00 00 00 00 00 00 00 00 ┊ 00 00 00 00 00 00 00 00 ┊ 00 00 00 00 00 00 00 00 │⋄⋄⋄⋄⋄⋄⋄⋄┊⋄⋄⋄⋄⋄⋄⋄⋄┊⋄⋄⋄⋄⋄⋄⋄⋄│
|
||||||
|
│* │ ┊ ┊ │ ┊ ┊ │
|
||||||
|
│00001000│ ba 0e 00 00 00 b9 00 20 ┊ 40 00 bb 01 00 00 00 b8 ┊ 04 00 00 00 cd 80 b8 01 │ו⋄⋄⋄×⋄ ┊@⋄ו⋄⋄⋄×┊•⋄⋄⋄××ו│
|
||||||
|
│00001018│ 00 00 00 cd 80 00 00 00 ┊ 00 00 00 00 00 00 00 00 ┊ 00 00 00 00 00 00 00 00 │⋄⋄⋄××⋄⋄⋄┊⋄⋄⋄⋄⋄⋄⋄⋄┊⋄⋄⋄⋄⋄⋄⋄⋄│
|
||||||
|
│00001030│ 00 00 00 00 00 00 00 00 ┊ 00 00 00 00 00 00 00 00 ┊ 00 00 00 00 00 00 00 00 │⋄⋄⋄⋄⋄⋄⋄⋄┊⋄⋄⋄⋄⋄⋄⋄⋄┊⋄⋄⋄⋄⋄⋄⋄⋄│
|
||||||
|
│* │ ┊ ┊ │ ┊ ┊ │
|
||||||
|
│000013f0│ 00 00 00 00 00 00 00 00 ┊ 00 00 00 00 ┊ │⋄⋄⋄⋄⋄⋄⋄⋄┊⋄⋄⋄⋄ ┊ │
|
||||||
|
└────────┴─────────────────────────┴─────────────────────────┴─────────────────────────┴────────┴────────┴────────┘
|
||||||
|
",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn squeeze_plain() {
|
||||||
|
hexyl()
|
||||||
|
.arg("hello_world_elf64")
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--skip=1024")
|
||||||
|
.arg("--length=4096")
|
||||||
|
.arg("--plain")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.pretty_stdout(
|
||||||
|
" \
|
||||||
|
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||||
|
*
|
||||||
|
ba 0e 00 00 00 b9 00 20 40 00 bb 01 00 00 00 b8
|
||||||
|
04 00 00 00 cd 80 b8 01 00 00 00 cd 80 00 00 00
|
||||||
|
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||||
|
*
|
||||||
|
*
|
||||||
|
",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn squeeze_plain_remainder() {
|
||||||
|
hexyl()
|
||||||
|
.arg("hello_world_elf64")
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--skip=1024")
|
||||||
|
.arg("--length=4092") // 4 byte remainder
|
||||||
|
.arg("--plain")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.pretty_stdout(
|
||||||
|
" \
|
||||||
|
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||||
|
*
|
||||||
|
ba 0e 00 00 00 b9 00 20 40 00 bb 01 00 00 00 b8
|
||||||
|
04 00 00 00 cd 80 b8 01 00 00 00 cd 80 00 00 00
|
||||||
|
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||||
|
*
|
||||||
|
00 00 00 00 00 00 00 00 00 00 00 00
|
||||||
|
",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mod base {
|
||||||
|
use super::hexyl;
|
||||||
|
use super::PrettyAssert;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn base2() {
|
||||||
|
hexyl()
|
||||||
|
.arg("ascii")
|
||||||
|
.arg("--plain")
|
||||||
|
.arg("--base=binary")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.pretty_stdout(
|
||||||
|
" 00110000 00110001 00110010 00110011 00110100 00110101 00110110 00110111 \n \
|
||||||
|
00111000 00111001 01100001 01100010 01100011 01100100 01100101 00001010 \n",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user