mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
Merge branch 'main' into kill-group-id
This commit is contained in:
commit
2a969de2a4
120 changed files with 991 additions and 433 deletions
44
.github/workflows/CICD.yml
vendored
44
.github/workflows/CICD.yml
vendored
|
@ -24,7 +24,7 @@ jobs:
|
||||||
name: Style/cargo-deny
|
name: Style/cargo-deny
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: EmbarkStudios/cargo-deny-action@v1
|
- uses: EmbarkStudios/cargo-deny-action@v1
|
||||||
|
|
||||||
style_deps:
|
style_deps:
|
||||||
|
@ -43,7 +43,7 @@ jobs:
|
||||||
- { os: macos-latest , features: "feat_Tier1,feat_require_unix,feat_require_unix_utmpx" }
|
- { os: macos-latest , features: "feat_Tier1,feat_require_unix,feat_require_unix_utmpx" }
|
||||||
- { os: windows-latest , features: feat_os_windows }
|
- { os: windows-latest , features: feat_os_windows }
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: Swatinem/rust-cache@v1
|
- uses: Swatinem/rust-cache@v1
|
||||||
- name: Initialize workflow variables
|
- name: Initialize workflow variables
|
||||||
id: vars
|
id: vars
|
||||||
|
@ -101,7 +101,7 @@ jobs:
|
||||||
job:
|
job:
|
||||||
- { os: ubuntu-latest , features: feat_os_unix }
|
- { os: ubuntu-latest , features: feat_os_unix }
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: Swatinem/rust-cache@v1
|
- uses: Swatinem/rust-cache@v1
|
||||||
- name: Initialize workflow variables
|
- name: Initialize workflow variables
|
||||||
id: vars
|
id: vars
|
||||||
|
@ -165,7 +165,7 @@ jobs:
|
||||||
- { os: macos-latest , features: feat_os_macos }
|
- { os: macos-latest , features: feat_os_macos }
|
||||||
- { os: windows-latest , features: feat_os_windows }
|
- { os: windows-latest , features: feat_os_windows }
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: Swatinem/rust-cache@v1
|
- uses: Swatinem/rust-cache@v1
|
||||||
- name: Initialize workflow variables
|
- name: Initialize workflow variables
|
||||||
id: vars
|
id: vars
|
||||||
|
@ -223,7 +223,7 @@ jobs:
|
||||||
job:
|
job:
|
||||||
- { os: ubuntu-latest , features: feat_os_unix }
|
- { os: ubuntu-latest , features: feat_os_unix }
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: Swatinem/rust-cache@v1
|
- uses: Swatinem/rust-cache@v1
|
||||||
- name: Initialize workflow variables
|
- name: Initialize workflow variables
|
||||||
id: vars
|
id: vars
|
||||||
|
@ -275,7 +275,7 @@ jobs:
|
||||||
# - { os: macos-latest , features: feat_os_macos }
|
# - { os: macos-latest , features: feat_os_macos }
|
||||||
# - { os: windows-latest , features: feat_os_windows }
|
# - { os: windows-latest , features: feat_os_windows }
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: Swatinem/rust-cache@v1
|
- uses: Swatinem/rust-cache@v1
|
||||||
- name: Initialize workflow variables
|
- name: Initialize workflow variables
|
||||||
id: vars
|
id: vars
|
||||||
|
@ -320,7 +320,7 @@ jobs:
|
||||||
job:
|
job:
|
||||||
- { os: ubuntu-latest , features: feat_os_unix }
|
- { os: ubuntu-latest , features: feat_os_unix }
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: Swatinem/rust-cache@v1
|
- uses: Swatinem/rust-cache@v1
|
||||||
- name: Initialize workflow variables
|
- name: Initialize workflow variables
|
||||||
id: vars
|
id: vars
|
||||||
|
@ -397,7 +397,7 @@ jobs:
|
||||||
job:
|
job:
|
||||||
- { os: ubuntu-latest , features: feat_os_unix }
|
- { os: ubuntu-latest , features: feat_os_unix }
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: Swatinem/rust-cache@v1
|
- uses: Swatinem/rust-cache@v1
|
||||||
- name: Install `rust` toolchain
|
- name: Install `rust` toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
|
@ -422,7 +422,7 @@ jobs:
|
||||||
job:
|
job:
|
||||||
- { os: ubuntu-latest , features: feat_os_unix }
|
- { os: ubuntu-latest , features: feat_os_unix }
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: Swatinem/rust-cache@v1
|
- uses: Swatinem/rust-cache@v1
|
||||||
- name: Install `rust` toolchain
|
- name: Install `rust` toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
|
@ -452,7 +452,7 @@ jobs:
|
||||||
- { os: macos-latest , features: feat_os_macos }
|
- { os: macos-latest , features: feat_os_macos }
|
||||||
- { os: windows-latest , features: feat_os_windows }
|
- { os: windows-latest , features: feat_os_windows }
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: Swatinem/rust-cache@v1
|
- uses: Swatinem/rust-cache@v1
|
||||||
- name: Install `rust` toolchain
|
- name: Install `rust` toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
|
@ -478,7 +478,7 @@ jobs:
|
||||||
- { os: macos-latest , features: feat_os_macos }
|
- { os: macos-latest , features: feat_os_macos }
|
||||||
- { os: windows-latest , features: feat_os_windows }
|
- { os: windows-latest , features: feat_os_windows }
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: Swatinem/rust-cache@v1
|
- uses: Swatinem/rust-cache@v1
|
||||||
- name: Install `rust` toolchain
|
- name: Install `rust` toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: actions-rs/toolchain@v1
|
||||||
|
@ -502,7 +502,7 @@ jobs:
|
||||||
job:
|
job:
|
||||||
- { os: ubuntu-latest , features: feat_os_unix }
|
- { os: ubuntu-latest , features: feat_os_unix }
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: Swatinem/rust-cache@v1
|
- uses: Swatinem/rust-cache@v1
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
|
@ -534,7 +534,7 @@ jobs:
|
||||||
--arg size "$SIZE" \
|
--arg size "$SIZE" \
|
||||||
--arg multisize "$SIZEMULTI" \
|
--arg multisize "$SIZEMULTI" \
|
||||||
'{($date): { sha: $sha, size: $size, multisize: $multisize, }}' > size-result.json
|
'{($date): { sha: $sha, size: $size, multisize: $multisize, }}' > size-result.json
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: size-result
|
name: size-result
|
||||||
path: size-result.json
|
path: size-result.json
|
||||||
|
@ -568,7 +568,7 @@ jobs:
|
||||||
- { os: windows-latest , target: x86_64-pc-windows-gnu , features: feat_os_windows } ## note: requires rust >= 1.43.0 to link correctly
|
- { os: windows-latest , target: x86_64-pc-windows-gnu , features: feat_os_windows } ## note: requires rust >= 1.43.0 to link correctly
|
||||||
- { os: windows-latest , target: x86_64-pc-windows-msvc , features: feat_os_windows }
|
- { os: windows-latest , target: x86_64-pc-windows-msvc , features: feat_os_windows }
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: Swatinem/rust-cache@v1
|
- uses: Swatinem/rust-cache@v1
|
||||||
- name: Initialize workflow variables
|
- name: Initialize workflow variables
|
||||||
id: vars
|
id: vars
|
||||||
|
@ -762,7 +762,7 @@ jobs:
|
||||||
args: --target=${{ matrix.job.target }} ${{ steps.vars.outputs.CARGO_TEST_OPTIONS}} ${{ matrix.job.cargo-options }} ${{ steps.dep_vars.outputs.CARGO_UTILITY_LIST_OPTIONS }}
|
args: --target=${{ matrix.job.target }} ${{ steps.vars.outputs.CARGO_TEST_OPTIONS}} ${{ matrix.job.cargo-options }} ${{ steps.dep_vars.outputs.CARGO_UTILITY_LIST_OPTIONS }}
|
||||||
toolchain: ${{ env.RUST_MIN_SRV }}
|
toolchain: ${{ env.RUST_MIN_SRV }}
|
||||||
- name: Archive executable artifacts
|
- name: Archive executable artifacts
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ env.PROJECT_NAME }}-${{ matrix.job.target }}
|
name: ${{ env.PROJECT_NAME }}-${{ matrix.job.target }}
|
||||||
path: target/${{ matrix.job.target }}/release/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}
|
path: target/${{ matrix.job.target }}/release/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}
|
||||||
|
@ -820,7 +820,7 @@ jobs:
|
||||||
job:
|
job:
|
||||||
- { os: ubuntu-latest }
|
- { os: ubuntu-latest }
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: Swatinem/rust-cache@v1
|
- uses: Swatinem/rust-cache@v1
|
||||||
- name: Install/setup prerequisites
|
- name: Install/setup prerequisites
|
||||||
shell: bash
|
shell: bash
|
||||||
|
@ -857,9 +857,9 @@ jobs:
|
||||||
env:
|
env:
|
||||||
TERMUX: v0.118.0
|
TERMUX: v0.118.0
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- name: AVD cache
|
- name: AVD cache
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
id: avd-cache
|
id: avd-cache
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
|
@ -911,11 +911,11 @@ jobs:
|
||||||
env:
|
env:
|
||||||
mem: 2048
|
mem: 2048
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: Swatinem/rust-cache@v1
|
- uses: Swatinem/rust-cache@v1
|
||||||
- name: Prepare, build and test
|
- name: Prepare, build and test
|
||||||
## spell-checker:ignore (ToDO) sshfs usesh vmactions
|
## spell-checker:ignore (ToDO) sshfs usesh vmactions
|
||||||
uses: vmactions/freebsd-vm@v0.1.5
|
uses: vmactions/freebsd-vm@v0.1.6
|
||||||
with:
|
with:
|
||||||
usesh: true
|
usesh: true
|
||||||
# sync: sshfs
|
# sync: sshfs
|
||||||
|
@ -979,7 +979,7 @@ jobs:
|
||||||
- { os: macos-latest , features: macos }
|
- { os: macos-latest , features: macos }
|
||||||
- { os: windows-latest , features: windows }
|
- { os: windows-latest , features: windows }
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: Swatinem/rust-cache@v1
|
- uses: Swatinem/rust-cache@v1
|
||||||
# - name: Reattach HEAD ## may be needed for accurate code coverage info
|
# - name: Reattach HEAD ## may be needed for accurate code coverage info
|
||||||
# run: git checkout ${{ github.head_ref }}
|
# run: git checkout ${{ github.head_ref }}
|
||||||
|
@ -1100,7 +1100,7 @@ jobs:
|
||||||
grcov . --output-type lcov --output-path "${COVERAGE_REPORT_FILE}" --branch --ignore build.rs --ignore "vendor/*" --ignore "/*" --ignore "[a-zA-Z]:/*" --excl-br-line "^\s*((debug_)?assert(_eq|_ne)?!|#\[derive\()"
|
grcov . --output-type lcov --output-path "${COVERAGE_REPORT_FILE}" --branch --ignore build.rs --ignore "vendor/*" --ignore "/*" --ignore "[a-zA-Z]:/*" --excl-br-line "^\s*((debug_)?assert(_eq|_ne)?!|#\[derive\()"
|
||||||
echo ::set-output name=report::${COVERAGE_REPORT_FILE}
|
echo ::set-output name=report::${COVERAGE_REPORT_FILE}
|
||||||
- name: Upload coverage results (to Codecov.io)
|
- name: Upload coverage results (to Codecov.io)
|
||||||
uses: codecov/codecov-action@v1
|
uses: codecov/codecov-action@v3
|
||||||
# if: steps.vars.outputs.HAS_CODECOV_TOKEN
|
# if: steps.vars.outputs.HAS_CODECOV_TOKEN
|
||||||
with:
|
with:
|
||||||
# token: ${{ secrets.CODECOV_TOKEN }}
|
# token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
|
8
.github/workflows/FixPR.yml
vendored
8
.github/workflows/FixPR.yml
vendored
|
@ -28,7 +28,7 @@ jobs:
|
||||||
job:
|
job:
|
||||||
- { os: ubuntu-latest , features: feat_os_unix }
|
- { os: ubuntu-latest , features: feat_os_unix }
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: Swatinem/rust-cache@v1
|
- uses: Swatinem/rust-cache@v1
|
||||||
- name: Initialize job variables
|
- name: Initialize job variables
|
||||||
id: vars
|
id: vars
|
||||||
|
@ -80,7 +80,7 @@ jobs:
|
||||||
## * using the 'stable' toolchain is necessary to avoid "unexpected '--filter-platform'" errors
|
## * using the 'stable' toolchain is necessary to avoid "unexpected '--filter-platform'" errors
|
||||||
RUSTUP_TOOLCHAIN=stable cargo-tree tree --locked --all --no-dev-dependencies --no-indent --features ${{ matrix.job.features }} | grep -vE "$PWD" | sort --unique
|
RUSTUP_TOOLCHAIN=stable cargo-tree tree --locked --all --no-dev-dependencies --no-indent --features ${{ matrix.job.features }} | grep -vE "$PWD" | sort --unique
|
||||||
- name: Commit any changes (to '${{ env.BRANCH_TARGET }}')
|
- name: Commit any changes (to '${{ env.BRANCH_TARGET }}')
|
||||||
uses: EndBug/add-and-commit@v7
|
uses: EndBug/add-and-commit@v9
|
||||||
with:
|
with:
|
||||||
branch: ${{ env.BRANCH_TARGET }}
|
branch: ${{ env.BRANCH_TARGET }}
|
||||||
default_author: github_actions
|
default_author: github_actions
|
||||||
|
@ -100,7 +100,7 @@ jobs:
|
||||||
job:
|
job:
|
||||||
- { os: ubuntu-latest , features: feat_os_unix }
|
- { os: ubuntu-latest , features: feat_os_unix }
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: Swatinem/rust-cache@v1
|
- uses: Swatinem/rust-cache@v1
|
||||||
- name: Initialize job variables
|
- name: Initialize job variables
|
||||||
id: vars
|
id: vars
|
||||||
|
@ -130,7 +130,7 @@ jobs:
|
||||||
# `cargo fmt` of tests
|
# `cargo fmt` of tests
|
||||||
find tests -name "*.rs" -print0 | xargs -0 cargo fmt --
|
find tests -name "*.rs" -print0 | xargs -0 cargo fmt --
|
||||||
- name: Commit any changes (to '${{ env.BRANCH_TARGET }}')
|
- name: Commit any changes (to '${{ env.BRANCH_TARGET }}')
|
||||||
uses: EndBug/add-and-commit@v7
|
uses: EndBug/add-and-commit@v9
|
||||||
with:
|
with:
|
||||||
branch: ${{ env.BRANCH_TARGET }}
|
branch: ${{ env.BRANCH_TARGET }}
|
||||||
default_author: github_actions
|
default_author: github_actions
|
||||||
|
|
18
.github/workflows/GnuTests.yml
vendored
18
.github/workflows/GnuTests.yml
vendored
|
@ -41,11 +41,11 @@ jobs:
|
||||||
TEST_FULL_SUMMARY_FILE='gnu-full-result.json'
|
TEST_FULL_SUMMARY_FILE='gnu-full-result.json'
|
||||||
outputs SUITE_LOG_FILE TEST_FILESET_PREFIX TEST_FILESET_SUFFIX TEST_LOGS_GLOB TEST_SUMMARY_FILE TEST_FULL_SUMMARY_FILE
|
outputs SUITE_LOG_FILE TEST_FILESET_PREFIX TEST_FILESET_SUFFIX TEST_LOGS_GLOB TEST_SUMMARY_FILE TEST_FULL_SUMMARY_FILE
|
||||||
- name: Checkout code (uutil)
|
- name: Checkout code (uutil)
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
path: '${{ steps.vars.outputs.path_UUTILS }}'
|
path: '${{ steps.vars.outputs.path_UUTILS }}'
|
||||||
- name: Checkout code (GNU coreutils)
|
- name: Checkout code (GNU coreutils)
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
repository: 'coreutils/coreutils'
|
repository: 'coreutils/coreutils'
|
||||||
path: '${{ steps.vars.outputs.path_GNU }}'
|
path: '${{ steps.vars.outputs.path_GNU }}'
|
||||||
|
@ -146,22 +146,22 @@ jobs:
|
||||||
# Compress logs before upload (fails otherwise)
|
# Compress logs before upload (fails otherwise)
|
||||||
gzip ${{ steps.vars.outputs.TEST_LOGS_GLOB }}
|
gzip ${{ steps.vars.outputs.TEST_LOGS_GLOB }}
|
||||||
- name: Reserve SHA1/ID of 'test-summary'
|
- name: Reserve SHA1/ID of 'test-summary'
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: "${{ steps.summary.outputs.HASH }}"
|
name: "${{ steps.summary.outputs.HASH }}"
|
||||||
path: "${{ steps.vars.outputs.TEST_SUMMARY_FILE }}"
|
path: "${{ steps.vars.outputs.TEST_SUMMARY_FILE }}"
|
||||||
- name: Reserve test results summary
|
- name: Reserve test results summary
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: test-summary
|
name: test-summary
|
||||||
path: "${{ steps.vars.outputs.TEST_SUMMARY_FILE }}"
|
path: "${{ steps.vars.outputs.TEST_SUMMARY_FILE }}"
|
||||||
- name: Reserve test logs
|
- name: Reserve test logs
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: test-logs
|
name: test-logs
|
||||||
path: "${{ steps.vars.outputs.TEST_LOGS_GLOB }}"
|
path: "${{ steps.vars.outputs.TEST_LOGS_GLOB }}"
|
||||||
- name: Upload full json results
|
- name: Upload full json results
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: gnu-full-result.json
|
name: gnu-full-result.json
|
||||||
path: ${{ steps.vars.outputs.TEST_FULL_SUMMARY_FILE }}
|
path: ${{ steps.vars.outputs.TEST_FULL_SUMMARY_FILE }}
|
||||||
|
@ -229,11 +229,11 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code uutil
|
- name: Checkout code uutil
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
path: 'uutils'
|
path: 'uutils'
|
||||||
- name: Checkout GNU coreutils
|
- name: Checkout GNU coreutils
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
repository: 'coreutils/coreutils'
|
repository: 'coreutils/coreutils'
|
||||||
path: 'gnu'
|
path: 'gnu'
|
||||||
|
@ -293,7 +293,7 @@ jobs:
|
||||||
grcov . --output-type lcov --output-path "${COVERAGE_REPORT_FILE}" --branch --ignore build.rs --ignore "vendor/*" --ignore "/*" --ignore "[a-zA-Z]:/*" --excl-br-line "^\s*((debug_)?assert(_eq|_ne)?!|#\[derive\()"
|
grcov . --output-type lcov --output-path "${COVERAGE_REPORT_FILE}" --branch --ignore build.rs --ignore "vendor/*" --ignore "/*" --ignore "[a-zA-Z]:/*" --excl-br-line "^\s*((debug_)?assert(_eq|_ne)?!|#\[derive\()"
|
||||||
echo ::set-output name=report::${COVERAGE_REPORT_FILE}
|
echo ::set-output name=report::${COVERAGE_REPORT_FILE}
|
||||||
- name: Upload coverage results (to Codecov.io)
|
- name: Upload coverage results (to Codecov.io)
|
||||||
uses: codecov/codecov-action@v2
|
uses: codecov/codecov-action@v3
|
||||||
with:
|
with:
|
||||||
file: ${{ steps.coverage.outputs.report }}
|
file: ${{ steps.coverage.outputs.report }}
|
||||||
flags: gnutests
|
flags: gnutests
|
||||||
|
|
236
Cargo.lock
generated
236
Cargo.lock
generated
|
@ -256,9 +256,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap"
|
name = "clap"
|
||||||
version = "3.1.15"
|
version = "3.1.18"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "85a35a599b11c089a7f49105658d089b8f2cf0882993c17daf6de15285c2c35d"
|
checksum = "d2dbdf4bdacb33466e854ce889eee8dfd5729abf7ccd7664d0a2d60cd384440b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atty",
|
"atty",
|
||||||
"bitflags",
|
"bitflags",
|
||||||
|
@ -273,11 +273,11 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clap_complete"
|
name = "clap_complete"
|
||||||
version = "3.1.3"
|
version = "3.1.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1d7ca9141e27e6ebc52e3c378b0c07f3cea52db46ed1cc5861735fb697b56356"
|
checksum = "da92e6facd8d73c22745a5d3cbb59bdf8e46e3235c923e516527d8e81eec14a4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -316,7 +316,7 @@ version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atty",
|
"atty",
|
||||||
"chrono",
|
"chrono",
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"clap_complete",
|
"clap_complete",
|
||||||
"conv",
|
"conv",
|
||||||
"filetime",
|
"filetime",
|
||||||
|
@ -1021,9 +1021,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.125"
|
version = "0.2.126"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5916d2ae698f6de9bfb891ad7a8d65c09d232dc58cc4ac433c7da3b2fd84bc2b"
|
checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libloading"
|
name = "libloading"
|
||||||
|
@ -1055,9 +1055,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lscolors"
|
name = "lscolors"
|
||||||
version = "0.9.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 = "4e9323b3525d4efad2dead1837a105e313253bfdbad1d470994038eededa4d62"
|
checksum = "88e4434edeec6cd16a7e8e13569af4568a66fcd6d79abd8696db22dd95f920e6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ansi_term",
|
"ansi_term",
|
||||||
]
|
]
|
||||||
|
@ -1531,9 +1531,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rayon"
|
name = "rayon"
|
||||||
version = "1.5.2"
|
version = "1.5.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fd249e82c21598a9a426a4e00dd7adc1d640b22445ec8545feef801d1a74c221"
|
checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"autocfg",
|
"autocfg",
|
||||||
"crossbeam-deque",
|
"crossbeam-deque",
|
||||||
|
@ -1740,9 +1740,9 @@ checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "signal-hook"
|
name = "signal-hook"
|
||||||
version = "0.3.13"
|
version = "0.3.14"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "647c97df271007dcea485bb74ffdb57f2e683f1306c854f468a0c244badabf2d"
|
checksum = "a253b5e89e2698464fc26b545c9edceb338e18a89effeeecfea192c3025be29d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"signal-hook-registry",
|
"signal-hook-registry",
|
||||||
|
@ -2028,9 +2028,9 @@ checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unindent"
|
name = "unindent"
|
||||||
version = "0.1.8"
|
version = "0.1.9"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "514672a55d7380da379785a4d70ca8386c8883ff7eaae877be4d2081cebe73d8"
|
checksum = "52fee519a3e570f7df377a06a1a7775cdbfb7aa460be7e08de2b1f0e69973a44"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unix_socket"
|
name = "unix_socket"
|
||||||
|
@ -2068,7 +2068,7 @@ checksum = "7cf7d77f457ef8dfa11e4cd5933c5ddb5dc52a94664071951219a97710f0a32b"
|
||||||
name = "uu_arch"
|
name = "uu_arch"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"platform-info",
|
"platform-info",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
@ -2077,7 +2077,7 @@ dependencies = [
|
||||||
name = "uu_base32"
|
name = "uu_base32"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2093,7 +2093,7 @@ dependencies = [
|
||||||
name = "uu_basename"
|
name = "uu_basename"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2101,7 +2101,7 @@ dependencies = [
|
||||||
name = "uu_basenc"
|
name = "uu_basenc"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uu_base32",
|
"uu_base32",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
@ -2111,7 +2111,7 @@ name = "uu_cat"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atty",
|
"atty",
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"nix",
|
"nix",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"unix_socket",
|
"unix_socket",
|
||||||
|
@ -2122,7 +2122,7 @@ dependencies = [
|
||||||
name = "uu_chcon"
|
name = "uu_chcon"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"fts-sys",
|
"fts-sys",
|
||||||
"libc",
|
"libc",
|
||||||
"selinux",
|
"selinux",
|
||||||
|
@ -2134,7 +2134,7 @@ dependencies = [
|
||||||
name = "uu_chgrp"
|
name = "uu_chgrp"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2142,7 +2142,7 @@ dependencies = [
|
||||||
name = "uu_chmod"
|
name = "uu_chmod"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"libc",
|
"libc",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
@ -2151,7 +2151,7 @@ dependencies = [
|
||||||
name = "uu_chown"
|
name = "uu_chown"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2159,7 +2159,7 @@ dependencies = [
|
||||||
name = "uu_chroot"
|
name = "uu_chroot"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2167,7 +2167,7 @@ dependencies = [
|
||||||
name = "uu_cksum"
|
name = "uu_cksum"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2175,7 +2175,7 @@ dependencies = [
|
||||||
name = "uu_comm"
|
name = "uu_comm"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2183,7 +2183,7 @@ dependencies = [
|
||||||
name = "uu_cp"
|
name = "uu_cp"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"exacl",
|
"exacl",
|
||||||
"filetime",
|
"filetime",
|
||||||
"ioctl-sys",
|
"ioctl-sys",
|
||||||
|
@ -2200,7 +2200,7 @@ dependencies = [
|
||||||
name = "uu_csplit"
|
name = "uu_csplit"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"regex",
|
"regex",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"uucore",
|
"uucore",
|
||||||
|
@ -2212,7 +2212,7 @@ version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atty",
|
"atty",
|
||||||
"bstr",
|
"bstr",
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"memchr 2.5.0",
|
"memchr 2.5.0",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
@ -2222,7 +2222,7 @@ name = "uu_date"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"libc",
|
"libc",
|
||||||
"uucore",
|
"uucore",
|
||||||
"winapi 0.3.9",
|
"winapi 0.3.9",
|
||||||
|
@ -2233,7 +2233,7 @@ name = "uu_dd"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"byte-unit",
|
"byte-unit",
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"gcd",
|
"gcd",
|
||||||
"libc",
|
"libc",
|
||||||
"signal-hook",
|
"signal-hook",
|
||||||
|
@ -2244,7 +2244,7 @@ dependencies = [
|
||||||
name = "uu_df"
|
name = "uu_df"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"number_prefix",
|
"number_prefix",
|
||||||
"unicode-width",
|
"unicode-width",
|
||||||
"uucore",
|
"uucore",
|
||||||
|
@ -2254,7 +2254,7 @@ dependencies = [
|
||||||
name = "uu_dir"
|
name = "uu_dir"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"selinux",
|
"selinux",
|
||||||
"uu_ls",
|
"uu_ls",
|
||||||
"uucore",
|
"uucore",
|
||||||
|
@ -2264,7 +2264,7 @@ dependencies = [
|
||||||
name = "uu_dircolors"
|
name = "uu_dircolors"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"glob",
|
"glob",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
@ -2273,7 +2273,7 @@ dependencies = [
|
||||||
name = "uu_dirname"
|
name = "uu_dirname"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2282,7 +2282,7 @@ name = "uu_du"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"glob",
|
"glob",
|
||||||
"uucore",
|
"uucore",
|
||||||
"winapi 0.3.9",
|
"winapi 0.3.9",
|
||||||
|
@ -2292,7 +2292,7 @@ dependencies = [
|
||||||
name = "uu_echo"
|
name = "uu_echo"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2300,7 +2300,7 @@ dependencies = [
|
||||||
name = "uu_env"
|
name = "uu_env"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"rust-ini",
|
"rust-ini",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
@ -2309,7 +2309,7 @@ dependencies = [
|
||||||
name = "uu_expand"
|
name = "uu_expand"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"unicode-width",
|
"unicode-width",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
@ -2318,7 +2318,7 @@ dependencies = [
|
||||||
name = "uu_expr"
|
name = "uu_expr"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"num-bigint",
|
"num-bigint",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
"onig",
|
"onig",
|
||||||
|
@ -2329,7 +2329,7 @@ dependencies = [
|
||||||
name = "uu_factor"
|
name = "uu_factor"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"coz",
|
"coz",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
"paste",
|
"paste",
|
||||||
|
@ -2343,7 +2343,7 @@ dependencies = [
|
||||||
name = "uu_false"
|
name = "uu_false"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2351,7 +2351,7 @@ dependencies = [
|
||||||
name = "uu_fmt"
|
name = "uu_fmt"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"unicode-width",
|
"unicode-width",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
@ -2360,7 +2360,7 @@ dependencies = [
|
||||||
name = "uu_fold"
|
name = "uu_fold"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2368,7 +2368,7 @@ dependencies = [
|
||||||
name = "uu_groups"
|
name = "uu_groups"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2378,7 +2378,7 @@ version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"blake2b_simd",
|
"blake2b_simd",
|
||||||
"blake3",
|
"blake3",
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"digest",
|
"digest",
|
||||||
"hex",
|
"hex",
|
||||||
"md-5",
|
"md-5",
|
||||||
|
@ -2394,7 +2394,7 @@ dependencies = [
|
||||||
name = "uu_head"
|
name = "uu_head"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"memchr 2.5.0",
|
"memchr 2.5.0",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
@ -2403,7 +2403,7 @@ dependencies = [
|
||||||
name = "uu_hostid"
|
name = "uu_hostid"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"libc",
|
"libc",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
@ -2412,7 +2412,7 @@ dependencies = [
|
||||||
name = "uu_hostname"
|
name = "uu_hostname"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"hostname",
|
"hostname",
|
||||||
"uucore",
|
"uucore",
|
||||||
"winapi 0.3.9",
|
"winapi 0.3.9",
|
||||||
|
@ -2422,7 +2422,7 @@ dependencies = [
|
||||||
name = "uu_id"
|
name = "uu_id"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"selinux",
|
"selinux",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
@ -2431,7 +2431,7 @@ dependencies = [
|
||||||
name = "uu_install"
|
name = "uu_install"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"file_diff",
|
"file_diff",
|
||||||
"filetime",
|
"filetime",
|
||||||
"libc",
|
"libc",
|
||||||
|
@ -2443,7 +2443,7 @@ dependencies = [
|
||||||
name = "uu_join"
|
name = "uu_join"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"memchr 2.5.0",
|
"memchr 2.5.0",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
@ -2452,7 +2452,7 @@ dependencies = [
|
||||||
name = "uu_kill"
|
name = "uu_kill"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"nix",
|
"nix",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
@ -2461,7 +2461,7 @@ dependencies = [
|
||||||
name = "uu_link"
|
name = "uu_link"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2469,7 +2469,7 @@ dependencies = [
|
||||||
name = "uu_ln"
|
name = "uu_ln"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2477,7 +2477,7 @@ dependencies = [
|
||||||
name = "uu_logname"
|
name = "uu_logname"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"libc",
|
"libc",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
@ -2488,7 +2488,7 @@ version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atty",
|
"atty",
|
||||||
"chrono",
|
"chrono",
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"glob",
|
"glob",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"lscolors",
|
"lscolors",
|
||||||
|
@ -2505,7 +2505,7 @@ dependencies = [
|
||||||
name = "uu_mkdir"
|
name = "uu_mkdir"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2513,7 +2513,7 @@ dependencies = [
|
||||||
name = "uu_mkfifo"
|
name = "uu_mkfifo"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"libc",
|
"libc",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
@ -2522,7 +2522,7 @@ dependencies = [
|
||||||
name = "uu_mknod"
|
name = "uu_mknod"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"libc",
|
"libc",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
@ -2531,7 +2531,7 @@ dependencies = [
|
||||||
name = "uu_mktemp"
|
name = "uu_mktemp"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"rand",
|
"rand",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
"uucore",
|
"uucore",
|
||||||
|
@ -2542,7 +2542,7 @@ name = "uu_more"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atty",
|
"atty",
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"crossterm",
|
"crossterm",
|
||||||
"nix",
|
"nix",
|
||||||
"unicode-segmentation",
|
"unicode-segmentation",
|
||||||
|
@ -2554,7 +2554,7 @@ dependencies = [
|
||||||
name = "uu_mv"
|
name = "uu_mv"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"fs_extra",
|
"fs_extra",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
@ -2563,7 +2563,7 @@ dependencies = [
|
||||||
name = "uu_nice"
|
name = "uu_nice"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"libc",
|
"libc",
|
||||||
"nix",
|
"nix",
|
||||||
"uucore",
|
"uucore",
|
||||||
|
@ -2573,7 +2573,7 @@ dependencies = [
|
||||||
name = "uu_nl"
|
name = "uu_nl"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"regex",
|
"regex",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
@ -2583,7 +2583,7 @@ name = "uu_nohup"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atty",
|
"atty",
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"libc",
|
"libc",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
@ -2592,7 +2592,7 @@ dependencies = [
|
||||||
name = "uu_nproc"
|
name = "uu_nproc"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"libc",
|
"libc",
|
||||||
"num_cpus",
|
"num_cpus",
|
||||||
"uucore",
|
"uucore",
|
||||||
|
@ -2602,7 +2602,7 @@ dependencies = [
|
||||||
name = "uu_numfmt"
|
name = "uu_numfmt"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2611,7 +2611,7 @@ name = "uu_od"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"half",
|
"half",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
@ -2620,7 +2620,7 @@ dependencies = [
|
||||||
name = "uu_paste"
|
name = "uu_paste"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2628,7 +2628,7 @@ dependencies = [
|
||||||
name = "uu_pathchk"
|
name = "uu_pathchk"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"libc",
|
"libc",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
@ -2637,7 +2637,7 @@ dependencies = [
|
||||||
name = "uu_pinky"
|
name = "uu_pinky"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2646,7 +2646,7 @@ name = "uu_pr"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"itertools",
|
"itertools",
|
||||||
"quick-error",
|
"quick-error",
|
||||||
"regex",
|
"regex",
|
||||||
|
@ -2657,7 +2657,7 @@ dependencies = [
|
||||||
name = "uu_printenv"
|
name = "uu_printenv"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2665,7 +2665,7 @@ dependencies = [
|
||||||
name = "uu_printf"
|
name = "uu_printf"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2673,7 +2673,7 @@ dependencies = [
|
||||||
name = "uu_ptx"
|
name = "uu_ptx"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"regex",
|
"regex",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
@ -2682,7 +2682,7 @@ dependencies = [
|
||||||
name = "uu_pwd"
|
name = "uu_pwd"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2690,7 +2690,7 @@ dependencies = [
|
||||||
name = "uu_readlink"
|
name = "uu_readlink"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2698,7 +2698,7 @@ dependencies = [
|
||||||
name = "uu_realpath"
|
name = "uu_realpath"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2706,7 +2706,7 @@ dependencies = [
|
||||||
name = "uu_relpath"
|
name = "uu_relpath"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2714,7 +2714,7 @@ dependencies = [
|
||||||
name = "uu_rm"
|
name = "uu_rm"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"remove_dir_all 0.7.0",
|
"remove_dir_all 0.7.0",
|
||||||
"uucore",
|
"uucore",
|
||||||
"walkdir",
|
"walkdir",
|
||||||
|
@ -2725,7 +2725,7 @@ dependencies = [
|
||||||
name = "uu_rmdir"
|
name = "uu_rmdir"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"libc",
|
"libc",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
@ -2734,7 +2734,7 @@ dependencies = [
|
||||||
name = "uu_runcon"
|
name = "uu_runcon"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"libc",
|
"libc",
|
||||||
"selinux",
|
"selinux",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
|
@ -2746,7 +2746,7 @@ name = "uu_seq"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bigdecimal",
|
"bigdecimal",
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"num-bigint",
|
"num-bigint",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
"uucore",
|
"uucore",
|
||||||
|
@ -2756,7 +2756,7 @@ dependencies = [
|
||||||
name = "uu_shred"
|
name = "uu_shred"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"rand",
|
"rand",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
@ -2765,7 +2765,7 @@ dependencies = [
|
||||||
name = "uu_shuf"
|
name = "uu_shuf"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"rand",
|
"rand",
|
||||||
"rand_core",
|
"rand_core",
|
||||||
"uucore",
|
"uucore",
|
||||||
|
@ -2775,7 +2775,7 @@ dependencies = [
|
||||||
name = "uu_sleep"
|
name = "uu_sleep"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2784,7 +2784,7 @@ name = "uu_sort"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"binary-heap-plus",
|
"binary-heap-plus",
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"compare",
|
"compare",
|
||||||
"ctrlc",
|
"ctrlc",
|
||||||
"fnv",
|
"fnv",
|
||||||
|
@ -2802,7 +2802,7 @@ dependencies = [
|
||||||
name = "uu_split"
|
name = "uu_split"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"memchr 2.5.0",
|
"memchr 2.5.0",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
@ -2811,7 +2811,7 @@ dependencies = [
|
||||||
name = "uu_stat"
|
name = "uu_stat"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2819,7 +2819,7 @@ dependencies = [
|
||||||
name = "uu_stdbuf"
|
name = "uu_stdbuf"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
"uu_stdbuf_libstdbuf",
|
"uu_stdbuf_libstdbuf",
|
||||||
"uucore",
|
"uucore",
|
||||||
|
@ -2839,7 +2839,7 @@ dependencies = [
|
||||||
name = "uu_sum"
|
name = "uu_sum"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2847,7 +2847,7 @@ dependencies = [
|
||||||
name = "uu_sync"
|
name = "uu_sync"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"libc",
|
"libc",
|
||||||
"uucore",
|
"uucore",
|
||||||
"winapi 0.3.9",
|
"winapi 0.3.9",
|
||||||
|
@ -2857,7 +2857,7 @@ dependencies = [
|
||||||
name = "uu_tac"
|
name = "uu_tac"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"memchr 2.5.0",
|
"memchr 2.5.0",
|
||||||
"memmap2",
|
"memmap2",
|
||||||
"regex",
|
"regex",
|
||||||
|
@ -2868,7 +2868,7 @@ dependencies = [
|
||||||
name = "uu_tail"
|
name = "uu_tail"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"libc",
|
"libc",
|
||||||
"nix",
|
"nix",
|
||||||
"uucore",
|
"uucore",
|
||||||
|
@ -2879,7 +2879,7 @@ dependencies = [
|
||||||
name = "uu_tee"
|
name = "uu_tee"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"libc",
|
"libc",
|
||||||
"retain_mut",
|
"retain_mut",
|
||||||
"uucore",
|
"uucore",
|
||||||
|
@ -2889,7 +2889,7 @@ dependencies = [
|
||||||
name = "uu_test"
|
name = "uu_test"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"libc",
|
"libc",
|
||||||
"redox_syscall",
|
"redox_syscall",
|
||||||
"uucore",
|
"uucore",
|
||||||
|
@ -2899,7 +2899,7 @@ dependencies = [
|
||||||
name = "uu_timeout"
|
name = "uu_timeout"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"libc",
|
"libc",
|
||||||
"nix",
|
"nix",
|
||||||
"uucore",
|
"uucore",
|
||||||
|
@ -2909,7 +2909,7 @@ dependencies = [
|
||||||
name = "uu_touch"
|
name = "uu_touch"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"filetime",
|
"filetime",
|
||||||
"time 0.3.9",
|
"time 0.3.9",
|
||||||
"uucore",
|
"uucore",
|
||||||
|
@ -2920,7 +2920,7 @@ dependencies = [
|
||||||
name = "uu_tr"
|
name = "uu_tr"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"nom",
|
"nom",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
@ -2929,7 +2929,7 @@ dependencies = [
|
||||||
name = "uu_true"
|
name = "uu_true"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2937,7 +2937,7 @@ dependencies = [
|
||||||
name = "uu_truncate"
|
name = "uu_truncate"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2945,7 +2945,7 @@ dependencies = [
|
||||||
name = "uu_tsort"
|
name = "uu_tsort"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -2954,7 +2954,7 @@ name = "uu_tty"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atty",
|
"atty",
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"libc",
|
"libc",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
@ -2963,7 +2963,7 @@ dependencies = [
|
||||||
name = "uu_uname"
|
name = "uu_uname"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"platform-info",
|
"platform-info",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
@ -2972,7 +2972,7 @@ dependencies = [
|
||||||
name = "uu_unexpand"
|
name = "uu_unexpand"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"unicode-width",
|
"unicode-width",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
@ -2981,7 +2981,7 @@ dependencies = [
|
||||||
name = "uu_uniq"
|
name = "uu_uniq"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"strum",
|
"strum",
|
||||||
"strum_macros",
|
"strum_macros",
|
||||||
"uucore",
|
"uucore",
|
||||||
|
@ -2991,7 +2991,7 @@ dependencies = [
|
||||||
name = "uu_unlink"
|
name = "uu_unlink"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -3000,7 +3000,7 @@ name = "uu_uptime"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -3008,7 +3008,7 @@ dependencies = [
|
||||||
name = "uu_users"
|
name = "uu_users"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -3016,7 +3016,7 @@ dependencies = [
|
||||||
name = "uu_vdir"
|
name = "uu_vdir"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"selinux",
|
"selinux",
|
||||||
"uu_ls",
|
"uu_ls",
|
||||||
"uucore",
|
"uucore",
|
||||||
|
@ -3027,7 +3027,7 @@ name = "uu_wc"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytecount",
|
"bytecount",
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"libc",
|
"libc",
|
||||||
"nix",
|
"nix",
|
||||||
"unicode-width",
|
"unicode-width",
|
||||||
|
@ -3039,7 +3039,7 @@ dependencies = [
|
||||||
name = "uu_who"
|
name = "uu_who"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -3047,7 +3047,7 @@ dependencies = [
|
||||||
name = "uu_whoami"
|
name = "uu_whoami"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"libc",
|
"libc",
|
||||||
"uucore",
|
"uucore",
|
||||||
"winapi 0.3.9",
|
"winapi 0.3.9",
|
||||||
|
@ -3057,7 +3057,7 @@ dependencies = [
|
||||||
name = "uu_yes"
|
name = "uu_yes"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"nix",
|
"nix",
|
||||||
"uucore",
|
"uucore",
|
||||||
]
|
]
|
||||||
|
@ -3066,7 +3066,7 @@ dependencies = [
|
||||||
name = "uucore"
|
name = "uucore"
|
||||||
version = "0.0.13"
|
version = "0.0.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap 3.1.15",
|
"clap 3.1.18",
|
||||||
"data-encoding",
|
"data-encoding",
|
||||||
"data-encoding-macro",
|
"data-encoding-macro",
|
||||||
"dns-lookup",
|
"dns-lookup",
|
||||||
|
|
|
@ -123,7 +123,12 @@ pub fn base_app<'a>(about: &'a str, usage: &'a str) -> Command<'a> {
|
||||||
)
|
)
|
||||||
// "multiple" arguments are used to check whether there is more than one
|
// "multiple" arguments are used to check whether there is more than one
|
||||||
// file passed in.
|
// file passed in.
|
||||||
.arg(Arg::new(options::FILE).index(1).multiple_occurrences(true))
|
.arg(
|
||||||
|
Arg::new(options::FILE)
|
||||||
|
.index(1)
|
||||||
|
.multiple_occurrences(true)
|
||||||
|
.value_hint(clap::ValueHint::FilePath),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_input<'a>(config: &Config, stdin_ref: &'a Stdin) -> UResult<Box<dyn Read + 'a>> {
|
pub fn get_input<'a>(config: &Config, stdin_ref: &'a Stdin) -> UResult<Box<dyn Read + 'a>> {
|
||||||
|
|
|
@ -102,6 +102,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::NAME)
|
Arg::new(options::NAME)
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
|
.value_hint(clap::ValueHint::AnyPath)
|
||||||
.hide(true),
|
.hide(true),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
|
|
|
@ -249,7 +249,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::FILE)
|
Arg::new(options::FILE)
|
||||||
.hide(true)
|
.hide(true)
|
||||||
.multiple_occurrences(true),
|
.multiple_occurrences(true)
|
||||||
|
.value_hint(clap::ValueHint::FilePath),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::SHOW_ALL)
|
Arg::new(options::SHOW_ALL)
|
||||||
|
|
|
@ -197,6 +197,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.long(options::REFERENCE)
|
.long(options::REFERENCE)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.value_name("RFILE")
|
.value_name("RFILE")
|
||||||
|
.value_hint(clap::ValueHint::FilePath)
|
||||||
.conflicts_with_all(&[options::USER, options::ROLE, options::TYPE, options::RANGE])
|
.conflicts_with_all(&[options::USER, options::ROLE, options::TYPE, options::RANGE])
|
||||||
.help(
|
.help(
|
||||||
"Use security context of RFILE, rather than specifying \
|
"Use security context of RFILE, rather than specifying \
|
||||||
|
@ -210,6 +211,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.long(options::USER)
|
.long(options::USER)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.value_name("USER")
|
.value_name("USER")
|
||||||
|
.value_hint(clap::ValueHint::Username)
|
||||||
.help("Set user USER in the target security context.")
|
.help("Set user USER in the target security context.")
|
||||||
.allow_invalid_utf8(true),
|
.allow_invalid_utf8(true),
|
||||||
)
|
)
|
||||||
|
@ -294,6 +296,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new("FILE")
|
Arg::new("FILE")
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
|
.value_hint(clap::ValueHint::FilePath)
|
||||||
.min_values(1)
|
.min_values(1)
|
||||||
.allow_invalid_utf8(true),
|
.allow_invalid_utf8(true),
|
||||||
)
|
)
|
||||||
|
|
|
@ -113,6 +113,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
Arg::new(options::REFERENCE)
|
Arg::new(options::REFERENCE)
|
||||||
.long(options::REFERENCE)
|
.long(options::REFERENCE)
|
||||||
.value_name("RFILE")
|
.value_name("RFILE")
|
||||||
|
.value_hint(clap::ValueHint::FilePath)
|
||||||
.help("use RFILE's group rather than specifying GROUP values")
|
.help("use RFILE's group rather than specifying GROUP values")
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.multiple_occurrences(false),
|
.multiple_occurrences(false),
|
||||||
|
|
|
@ -16,7 +16,7 @@ path = "src/chmod.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "3.1", features = ["wrap_help", "cargo"] }
|
clap = { version = "3.1", features = ["wrap_help", "cargo"] }
|
||||||
libc = "0.2.125"
|
libc = "0.2.126"
|
||||||
uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["fs", "mode"] }
|
uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["fs", "mode"] }
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
|
|
|
@ -157,6 +157,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
Arg::new(options::REFERENCE)
|
Arg::new(options::REFERENCE)
|
||||||
.long("reference")
|
.long("reference")
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
|
.value_hint(clap::ValueHint::FilePath)
|
||||||
.help("use RFILE's mode instead of MODE values"),
|
.help("use RFILE's mode instead of MODE values"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
|
@ -170,7 +171,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::FILE)
|
Arg::new(options::FILE)
|
||||||
.required_unless_present(options::MODE)
|
.required_unless_present(options::MODE)
|
||||||
.multiple_occurrences(true),
|
.multiple_occurrences(true)
|
||||||
|
.value_hint(clap::ValueHint::AnyPath),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -134,6 +134,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.long(options::REFERENCE)
|
.long(options::REFERENCE)
|
||||||
.help("use RFILE's owner and group rather than specifying OWNER:GROUP values")
|
.help("use RFILE's owner and group rather than specifying OWNER:GROUP values")
|
||||||
.value_name("RFILE")
|
.value_name("RFILE")
|
||||||
|
.value_hint(clap::ValueHint::FilePath)
|
||||||
.min_values(1),
|
.min_values(1),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
|
@ -167,17 +168,18 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Parse the username and groupname
|
/// Parse the owner/group specifier string into a user ID and a group ID.
|
||||||
///
|
///
|
||||||
/// In theory, it should be username:groupname
|
/// The `spec` can be of the form:
|
||||||
/// but ...
|
|
||||||
/// it can user.name:groupname
|
|
||||||
/// or username.groupname
|
|
||||||
///
|
///
|
||||||
/// # Arguments
|
/// * `"owner:group"`,
|
||||||
|
/// * `"owner"`,
|
||||||
|
/// * `":group"`,
|
||||||
///
|
///
|
||||||
/// * `spec` - The input from the user
|
/// and the owner or group can be specified either as an ID or a
|
||||||
/// * `sep` - Should be ':' or '.'
|
/// name. The `sep` argument specifies which character to use as a
|
||||||
|
/// separator between the owner and group; calling code should set
|
||||||
|
/// this to `':'`.
|
||||||
fn parse_spec(spec: &str, sep: char) -> UResult<(Option<u32>, Option<u32>)> {
|
fn parse_spec(spec: &str, sep: char) -> UResult<(Option<u32>, Option<u32>)> {
|
||||||
assert!(['.', ':'].contains(&sep));
|
assert!(['.', ':'].contains(&sep));
|
||||||
let mut args = spec.splitn(2, sep);
|
let mut args = spec.splitn(2, sep);
|
||||||
|
@ -197,10 +199,17 @@ fn parse_spec(spec: &str, sep: char) -> UResult<(Option<u32>, Option<u32>)> {
|
||||||
// So, try to parse it this way
|
// So, try to parse it this way
|
||||||
return parse_spec(spec, '.');
|
return parse_spec(spec, '.');
|
||||||
} else {
|
} else {
|
||||||
return Err(USimpleError::new(
|
// It's possible that the `user` string contains a
|
||||||
1,
|
// numeric user ID, in which case, we respect that.
|
||||||
format!("invalid user: {}", spec.quote()),
|
match user.parse() {
|
||||||
));
|
Ok(uid) => uid,
|
||||||
|
Err(_) => {
|
||||||
|
return Err(USimpleError::new(
|
||||||
|
1,
|
||||||
|
format!("invalid user: {}", spec.quote()),
|
||||||
|
))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -208,11 +217,18 @@ fn parse_spec(spec: &str, sep: char) -> UResult<(Option<u32>, Option<u32>)> {
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
let gid = if !group.is_empty() {
|
let gid = if !group.is_empty() {
|
||||||
Some(
|
Some(match Group::locate(group) {
|
||||||
Group::locate(group)
|
Ok(g) => g.gid,
|
||||||
.map_err(|_| USimpleError::new(1, format!("invalid group: {}", spec.quote())))?
|
Err(_) => match group.parse() {
|
||||||
.gid,
|
Ok(gid) => gid,
|
||||||
)
|
Err(_) => {
|
||||||
|
return Err(USimpleError::new(
|
||||||
|
1,
|
||||||
|
format!("invalid group: {}", spec.quote()),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
@ -231,4 +247,17 @@ mod test {
|
||||||
assert!(format!("{}", parse_spec("::", ':').err().unwrap()).starts_with("invalid group: "));
|
assert!(format!("{}", parse_spec("::", ':').err().unwrap()).starts_with("invalid group: "));
|
||||||
assert!(format!("{}", parse_spec("..", ':').err().unwrap()).starts_with("invalid group: "));
|
assert!(format!("{}", parse_spec("..", ':').err().unwrap()).starts_with("invalid group: "));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Test for parsing IDs that don't correspond to a named user or group.
|
||||||
|
#[test]
|
||||||
|
fn test_parse_spec_nameless_ids() {
|
||||||
|
// This assumes that there is no named user with ID 12345.
|
||||||
|
assert!(matches!(parse_spec("12345", ':'), Ok((Some(12345), None))));
|
||||||
|
// This assumes that there is no named group with ID 54321.
|
||||||
|
assert!(matches!(parse_spec(":54321", ':'), Ok((None, Some(54321)))));
|
||||||
|
assert!(matches!(
|
||||||
|
parse_spec("12345:54321", ':'),
|
||||||
|
Ok((Some(12345), Some(54321)))
|
||||||
|
));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,6 +102,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.infer_long_args(true)
|
.infer_long_args(true)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::NEWROOT)
|
Arg::new(options::NEWROOT)
|
||||||
|
.value_hint(clap::ValueHint::DirPath)
|
||||||
.hide(true)
|
.hide(true)
|
||||||
.required(true)
|
.required(true)
|
||||||
.index(1),
|
.index(1),
|
||||||
|
@ -139,6 +140,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::COMMAND)
|
Arg::new(options::COMMAND)
|
||||||
|
.value_hint(clap::ValueHint::CommandName)
|
||||||
.hide(true)
|
.hide(true)
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
.index(2),
|
.index(2),
|
||||||
|
|
|
@ -150,6 +150,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::FILE)
|
Arg::new(options::FILE)
|
||||||
.hide(true)
|
.hide(true)
|
||||||
.multiple_occurrences(true),
|
.multiple_occurrences(true)
|
||||||
|
.value_hint(clap::ValueHint::FilePath),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,6 +173,14 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.default_value(options::DELIMITER_DEFAULT)
|
.default_value(options::DELIMITER_DEFAULT)
|
||||||
.hide_default_value(true),
|
.hide_default_value(true),
|
||||||
)
|
)
|
||||||
.arg(Arg::new(options::FILE_1).required(true))
|
.arg(
|
||||||
.arg(Arg::new(options::FILE_2).required(true))
|
Arg::new(options::FILE_1)
|
||||||
|
.required(true)
|
||||||
|
.value_hint(clap::ValueHint::FilePath),
|
||||||
|
)
|
||||||
|
.arg(
|
||||||
|
Arg::new(options::FILE_2)
|
||||||
|
.required(true)
|
||||||
|
.value_hint(clap::ValueHint::FilePath),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ path = "src/cp.rs"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "3.1", features = ["wrap_help", "cargo"] }
|
clap = { version = "3.1", features = ["wrap_help", "cargo"] }
|
||||||
filetime = "0.2"
|
filetime = "0.2"
|
||||||
libc = "0.2.125"
|
libc = "0.2.126"
|
||||||
quick-error = "2.0.1"
|
quick-error = "2.0.1"
|
||||||
selinux = { version="0.2", optional=true }
|
selinux = { version="0.2", optional=true }
|
||||||
uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["entries", "fs", "perms", "mode"] }
|
uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["entries", "fs", "perms", "mode"] }
|
||||||
|
|
|
@ -314,6 +314,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.conflicts_with(options::NO_TARGET_DIRECTORY)
|
.conflicts_with(options::NO_TARGET_DIRECTORY)
|
||||||
.long(options::TARGET_DIRECTORY)
|
.long(options::TARGET_DIRECTORY)
|
||||||
.value_name(options::TARGET_DIRECTORY)
|
.value_name(options::TARGET_DIRECTORY)
|
||||||
|
.value_hint(clap::ValueHint::DirPath)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.validator(|s| {
|
.validator(|s| {
|
||||||
if Path::new(s).is_dir() {
|
if Path::new(s).is_dir() {
|
||||||
|
@ -464,7 +465,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
// END TODO
|
// END TODO
|
||||||
|
|
||||||
.arg(Arg::new(options::PATHS)
|
.arg(Arg::new(options::PATHS)
|
||||||
.multiple_occurrences(true))
|
.multiple_occurrences(true)
|
||||||
|
.value_hint(clap::ValueHint::AnyPath))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[uucore::main]
|
#[uucore::main]
|
||||||
|
|
|
@ -797,7 +797,12 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.long(options::ELIDE_EMPTY_FILES)
|
.long(options::ELIDE_EMPTY_FILES)
|
||||||
.help("remove empty output files"),
|
.help("remove empty output files"),
|
||||||
)
|
)
|
||||||
.arg(Arg::new(options::FILE).hide(true).required(true))
|
.arg(
|
||||||
|
Arg::new(options::FILE)
|
||||||
|
.hide(true)
|
||||||
|
.required(true)
|
||||||
|
.value_hint(clap::ValueHint::FilePath),
|
||||||
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::PATTERN)
|
Arg::new(options::PATTERN)
|
||||||
.hide(true)
|
.hide(true)
|
||||||
|
|
|
@ -614,6 +614,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::FILE)
|
Arg::new(options::FILE)
|
||||||
.hide(true)
|
.hide(true)
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
|
.value_hint(clap::ValueHint::FilePath)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -272,6 +272,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.short('f')
|
.short('f')
|
||||||
.long(OPT_FILE)
|
.long(OPT_FILE)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
|
.value_hint(clap::ValueHint::FilePath)
|
||||||
.help("like --date; once for each line of DATEFILE"),
|
.help("like --date; once for each line of DATEFILE"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
|
@ -303,6 +304,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.short('r')
|
.short('r')
|
||||||
.long(OPT_REFERENCE)
|
.long(OPT_REFERENCE)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
|
.value_hint(clap::ValueHint::AnyPath)
|
||||||
.help("display the last modification time of FILE"),
|
.help("display the last modification time of FILE"),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
|
|
|
@ -22,7 +22,7 @@ libc = "0.2"
|
||||||
uucore = { version=">=0.0.8", package="uucore", path="../../uucore" }
|
uucore = { version=">=0.0.8", package="uucore", path="../../uucore" }
|
||||||
|
|
||||||
[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies]
|
[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies]
|
||||||
signal-hook = "0.3.9"
|
signal-hook = "0.3.14"
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "dd"
|
name = "dd"
|
||||||
|
|
|
@ -742,6 +742,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.long(options::INFILE)
|
.long(options::INFILE)
|
||||||
.overrides_with(options::INFILE)
|
.overrides_with(options::INFILE)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
|
.value_hint(clap::ValueHint::FilePath)
|
||||||
.require_equals(true)
|
.require_equals(true)
|
||||||
.value_name("FILE")
|
.value_name("FILE")
|
||||||
.help("(alternatively if=FILE) specifies the file used for input. When not specified, stdin is used instead")
|
.help("(alternatively if=FILE) specifies the file used for input. When not specified, stdin is used instead")
|
||||||
|
@ -751,6 +752,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.long(options::OUTFILE)
|
.long(options::OUTFILE)
|
||||||
.overrides_with(options::OUTFILE)
|
.overrides_with(options::OUTFILE)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
|
.value_hint(clap::ValueHint::FilePath)
|
||||||
.require_equals(true)
|
.require_equals(true)
|
||||||
.value_name("FILE")
|
.value_name("FILE")
|
||||||
.help("(alternatively of=FILE) specifies the file used for output. When not specified, stdout is used instead")
|
.help("(alternatively of=FILE) specifies the file used for output. When not specified, stdout is used instead")
|
||||||
|
|
|
@ -388,7 +388,7 @@ fn parse_bytes_no_x(s: &str) -> Result<u64, ParseError> {
|
||||||
let (num, multiplier) = match (s.find('c'), s.rfind('w'), s.rfind('b')) {
|
let (num, multiplier) = match (s.find('c'), s.rfind('w'), s.rfind('b')) {
|
||||||
(None, None, None) => match uucore::parse_size::parse_size(s) {
|
(None, None, None) => match uucore::parse_size::parse_size(s) {
|
||||||
Ok(n) => (n, 1),
|
Ok(n) => (n, 1),
|
||||||
Err(ParseSizeError::ParseFailure(s)) => {
|
Err(ParseSizeError::InvalidSuffix(s)) | Err(ParseSizeError::ParseFailure(s)) => {
|
||||||
return Err(ParseError::MultiplierStringParseFailure(s))
|
return Err(ParseError::MultiplierStringParseFailure(s))
|
||||||
}
|
}
|
||||||
Err(ParseSizeError::SizeTooBig(s)) => {
|
Err(ParseSizeError::SizeTooBig(s)) => {
|
||||||
|
|
|
@ -7,7 +7,10 @@ use crate::OPT_BLOCKSIZE;
|
||||||
use clap::ArgMatches;
|
use clap::ArgMatches;
|
||||||
use std::{env, fmt};
|
use std::{env, fmt};
|
||||||
|
|
||||||
use uucore::parse_size::{parse_size, ParseSizeError};
|
use uucore::{
|
||||||
|
display::Quotable,
|
||||||
|
parse_size::{parse_size, ParseSizeError},
|
||||||
|
};
|
||||||
|
|
||||||
/// The first ten powers of 1024.
|
/// The first ten powers of 1024.
|
||||||
const IEC_BASES: [u128; 10] = [
|
const IEC_BASES: [u128; 10] = [
|
||||||
|
@ -167,6 +170,15 @@ pub(crate) enum BlockSize {
|
||||||
Bytes(u64),
|
Bytes(u64),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl BlockSize {
|
||||||
|
/// Returns the associated value
|
||||||
|
pub(crate) fn as_u64(&self) -> u64 {
|
||||||
|
match *self {
|
||||||
|
Self::Bytes(n) => n,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl Default for BlockSize {
|
impl Default for BlockSize {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
if env::var("POSIXLY_CORRECT").is_ok() {
|
if env::var("POSIXLY_CORRECT").is_ok() {
|
||||||
|
@ -180,7 +192,13 @@ impl Default for BlockSize {
|
||||||
pub(crate) fn block_size_from_matches(matches: &ArgMatches) -> Result<BlockSize, ParseSizeError> {
|
pub(crate) fn block_size_from_matches(matches: &ArgMatches) -> Result<BlockSize, ParseSizeError> {
|
||||||
if matches.is_present(OPT_BLOCKSIZE) {
|
if matches.is_present(OPT_BLOCKSIZE) {
|
||||||
let s = matches.value_of(OPT_BLOCKSIZE).unwrap();
|
let s = matches.value_of(OPT_BLOCKSIZE).unwrap();
|
||||||
Ok(BlockSize::Bytes(parse_size(s)?))
|
let bytes = parse_size(s)?;
|
||||||
|
|
||||||
|
if bytes > 0 {
|
||||||
|
Ok(BlockSize::Bytes(bytes))
|
||||||
|
} else {
|
||||||
|
Err(ParseSizeError::ParseFailure(format!("{}", s.quote())))
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Ok(Default::default())
|
Ok(Default::default())
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ mod filesystem;
|
||||||
mod table;
|
mod table;
|
||||||
|
|
||||||
use blocks::{HumanReadable, SizeFormat};
|
use blocks::{HumanReadable, SizeFormat};
|
||||||
|
use table::HeaderMode;
|
||||||
use uucore::display::Quotable;
|
use uucore::display::Quotable;
|
||||||
use uucore::error::{UError, UResult, USimpleError};
|
use uucore::error::{UError, UResult, USimpleError};
|
||||||
use uucore::fsext::{read_fs_list, MountInfo};
|
use uucore::fsext::{read_fs_list, MountInfo};
|
||||||
|
@ -72,6 +73,7 @@ struct Options {
|
||||||
show_all_fs: bool,
|
show_all_fs: bool,
|
||||||
size_format: SizeFormat,
|
size_format: SizeFormat,
|
||||||
block_size: BlockSize,
|
block_size: BlockSize,
|
||||||
|
header_mode: HeaderMode,
|
||||||
|
|
||||||
/// Optional list of filesystem types to include in the output table.
|
/// Optional list of filesystem types to include in the output table.
|
||||||
///
|
///
|
||||||
|
@ -99,6 +101,7 @@ impl Default for Options {
|
||||||
show_all_fs: Default::default(),
|
show_all_fs: Default::default(),
|
||||||
block_size: Default::default(),
|
block_size: Default::default(),
|
||||||
size_format: Default::default(),
|
size_format: Default::default(),
|
||||||
|
header_mode: Default::default(),
|
||||||
include: Default::default(),
|
include: Default::default(),
|
||||||
exclude: Default::default(),
|
exclude: Default::default(),
|
||||||
show_total: Default::default(),
|
show_total: Default::default(),
|
||||||
|
@ -118,6 +121,7 @@ impl Default for Options {
|
||||||
enum OptionsError {
|
enum OptionsError {
|
||||||
BlockSizeTooLarge(String),
|
BlockSizeTooLarge(String),
|
||||||
InvalidBlockSize(String),
|
InvalidBlockSize(String),
|
||||||
|
InvalidSuffix(String),
|
||||||
|
|
||||||
/// An error getting the columns to display in the output table.
|
/// An error getting the columns to display in the output table.
|
||||||
ColumnError(ColumnError),
|
ColumnError(ColumnError),
|
||||||
|
@ -136,6 +140,9 @@ impl fmt::Display for OptionsError {
|
||||||
// TODO This needs to vary based on whether `--block-size`
|
// TODO This needs to vary based on whether `--block-size`
|
||||||
// or `-B` were provided.
|
// or `-B` were provided.
|
||||||
Self::InvalidBlockSize(s) => write!(f, "invalid --block-size argument {}", s),
|
Self::InvalidBlockSize(s) => write!(f, "invalid --block-size argument {}", s),
|
||||||
|
// TODO This needs to vary based on whether `--block-size`
|
||||||
|
// or `-B` were provided.
|
||||||
|
Self::InvalidSuffix(s) => write!(f, "invalid suffix in --block-size argument {}", s),
|
||||||
Self::ColumnError(ColumnError::MultipleColumns(s)) => write!(
|
Self::ColumnError(ColumnError::MultipleColumns(s)) => write!(
|
||||||
f,
|
f,
|
||||||
"option --output: field {} used more than once",
|
"option --output: field {} used more than once",
|
||||||
|
@ -171,11 +178,27 @@ impl Options {
|
||||||
show_local_fs: matches.is_present(OPT_LOCAL),
|
show_local_fs: matches.is_present(OPT_LOCAL),
|
||||||
show_all_fs: matches.is_present(OPT_ALL),
|
show_all_fs: matches.is_present(OPT_ALL),
|
||||||
block_size: block_size_from_matches(matches).map_err(|e| match e {
|
block_size: block_size_from_matches(matches).map_err(|e| match e {
|
||||||
|
ParseSizeError::InvalidSuffix(s) => OptionsError::InvalidSuffix(s),
|
||||||
ParseSizeError::SizeTooBig(_) => OptionsError::BlockSizeTooLarge(
|
ParseSizeError::SizeTooBig(_) => OptionsError::BlockSizeTooLarge(
|
||||||
matches.value_of(OPT_BLOCKSIZE).unwrap().to_string(),
|
matches.value_of(OPT_BLOCKSIZE).unwrap().to_string(),
|
||||||
),
|
),
|
||||||
ParseSizeError::ParseFailure(s) => OptionsError::InvalidBlockSize(s),
|
ParseSizeError::ParseFailure(s) => OptionsError::InvalidBlockSize(s),
|
||||||
})?,
|
})?,
|
||||||
|
header_mode: {
|
||||||
|
if matches.is_present(OPT_HUMAN_READABLE_BINARY)
|
||||||
|
|| matches.is_present(OPT_HUMAN_READABLE_DECIMAL)
|
||||||
|
{
|
||||||
|
HeaderMode::HumanReadable
|
||||||
|
} else if matches.is_present(OPT_PORTABILITY) {
|
||||||
|
HeaderMode::PosixPortability
|
||||||
|
// is_present() doesn't work here, it always returns true because OPT_OUTPUT has
|
||||||
|
// default values and hence is always present
|
||||||
|
} else if matches.occurrences_of(OPT_OUTPUT) > 0 {
|
||||||
|
HeaderMode::Output
|
||||||
|
} else {
|
||||||
|
HeaderMode::Default
|
||||||
|
}
|
||||||
|
},
|
||||||
size_format: {
|
size_format: {
|
||||||
if matches.is_present(OPT_HUMAN_READABLE_BINARY) {
|
if matches.is_present(OPT_HUMAN_READABLE_BINARY) {
|
||||||
SizeFormat::HumanReadable(HumanReadable::Binary)
|
SizeFormat::HumanReadable(HumanReadable::Binary)
|
||||||
|
@ -565,7 +588,11 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
.help("limit listing to file systems not of type TYPE"),
|
.help("limit listing to file systems not of type TYPE"),
|
||||||
)
|
)
|
||||||
.arg(Arg::new(OPT_PATHS).multiple_occurrences(true))
|
.arg(
|
||||||
|
Arg::new(OPT_PATHS)
|
||||||
|
.multiple_occurrences(true)
|
||||||
|
.value_hint(clap::ValueHint::AnyPath),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|
|
@ -233,7 +233,7 @@ impl<'a> RowFormatter<'a> {
|
||||||
SizeFormat::HumanReadable(h) => self.scaled_human_readable(size, h),
|
SizeFormat::HumanReadable(h) => self.scaled_human_readable(size, h),
|
||||||
SizeFormat::StaticBlockSize => {
|
SizeFormat::StaticBlockSize => {
|
||||||
let BlockSize::Bytes(d) = self.options.block_size;
|
let BlockSize::Bytes(d) = self.options.block_size;
|
||||||
(size / d).to_string()
|
(size as f64 / d as f64).ceil().to_string()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -289,6 +289,23 @@ impl<'a> RowFormatter<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// A HeaderMode defines what header labels should be shown.
|
||||||
|
pub(crate) enum HeaderMode {
|
||||||
|
Default,
|
||||||
|
// the user used -h or -H
|
||||||
|
HumanReadable,
|
||||||
|
// the user used -P
|
||||||
|
PosixPortability,
|
||||||
|
// the user used --output
|
||||||
|
Output,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Default for HeaderMode {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self::Default
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// The data of the header row.
|
/// The data of the header row.
|
||||||
struct Header {}
|
struct Header {}
|
||||||
|
|
||||||
|
@ -302,15 +319,22 @@ impl Header {
|
||||||
for column in &options.columns {
|
for column in &options.columns {
|
||||||
let header = match column {
|
let header = match column {
|
||||||
Column::Source => String::from("Filesystem"),
|
Column::Source => String::from("Filesystem"),
|
||||||
Column::Size => match options.size_format {
|
Column::Size => match options.header_mode {
|
||||||
SizeFormat::HumanReadable(_) => String::from("Size"),
|
HeaderMode::HumanReadable => String::from("Size"),
|
||||||
SizeFormat::StaticBlockSize => {
|
HeaderMode::PosixPortability => {
|
||||||
format!("{}-blocks", options.block_size)
|
format!("{}-blocks", options.block_size.as_u64())
|
||||||
}
|
}
|
||||||
|
_ => format!("{}-blocks", options.block_size),
|
||||||
},
|
},
|
||||||
Column::Used => String::from("Used"),
|
Column::Used => String::from("Used"),
|
||||||
Column::Avail => String::from("Available"),
|
Column::Avail => match options.header_mode {
|
||||||
Column::Pcent => String::from("Use%"),
|
HeaderMode::HumanReadable | HeaderMode::Output => String::from("Avail"),
|
||||||
|
_ => String::from("Available"),
|
||||||
|
},
|
||||||
|
Column::Pcent => match options.header_mode {
|
||||||
|
HeaderMode::PosixPortability => String::from("Capacity"),
|
||||||
|
_ => String::from("Use%"),
|
||||||
|
},
|
||||||
Column::Target => String::from("Mounted on"),
|
Column::Target => String::from("Mounted on"),
|
||||||
Column::Itotal => String::from("Inodes"),
|
Column::Itotal => String::from("Inodes"),
|
||||||
Column::Iused => String::from("IUsed"),
|
Column::Iused => String::from("IUsed"),
|
||||||
|
@ -428,7 +452,7 @@ mod tests {
|
||||||
|
|
||||||
use crate::blocks::{HumanReadable, SizeFormat};
|
use crate::blocks::{HumanReadable, SizeFormat};
|
||||||
use crate::columns::Column;
|
use crate::columns::Column;
|
||||||
use crate::table::{Header, Row, RowFormatter};
|
use crate::table::{Header, HeaderMode, Row, RowFormatter};
|
||||||
use crate::{BlockSize, Options};
|
use crate::{BlockSize, Options};
|
||||||
|
|
||||||
const COLUMNS_WITH_FS_TYPE: [Column; 7] = [
|
const COLUMNS_WITH_FS_TYPE: [Column; 7] = [
|
||||||
|
@ -548,37 +572,49 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_header_with_human_readable_binary() {
|
fn test_human_readable_header() {
|
||||||
let options = Options {
|
let options = Options {
|
||||||
size_format: SizeFormat::HumanReadable(HumanReadable::Binary),
|
header_mode: HeaderMode::HumanReadable,
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
|
assert_eq!(
|
||||||
|
Header::get_headers(&options),
|
||||||
|
vec!("Filesystem", "Size", "Used", "Avail", "Use%", "Mounted on")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_posix_portability_header() {
|
||||||
|
let options = Options {
|
||||||
|
header_mode: HeaderMode::PosixPortability,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
Header::get_headers(&options),
|
Header::get_headers(&options),
|
||||||
vec!(
|
vec!(
|
||||||
"Filesystem",
|
"Filesystem",
|
||||||
"Size",
|
"1024-blocks",
|
||||||
"Used",
|
"Used",
|
||||||
"Available",
|
"Available",
|
||||||
"Use%",
|
"Capacity",
|
||||||
"Mounted on"
|
"Mounted on"
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_header_with_human_readable_si() {
|
fn test_output_header() {
|
||||||
let options = Options {
|
let options = Options {
|
||||||
size_format: SizeFormat::HumanReadable(HumanReadable::Decimal),
|
header_mode: HeaderMode::Output,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
Header::get_headers(&options),
|
Header::get_headers(&options),
|
||||||
vec!(
|
vec!(
|
||||||
"Filesystem",
|
"Filesystem",
|
||||||
"Size",
|
"1K-blocks",
|
||||||
"Used",
|
"Used",
|
||||||
"Available",
|
"Avail",
|
||||||
"Use%",
|
"Use%",
|
||||||
"Mounted on"
|
"Mounted on"
|
||||||
)
|
)
|
||||||
|
@ -757,4 +793,28 @@ mod tests {
|
||||||
let fmt = RowFormatter::new(&row, &options);
|
let fmt = RowFormatter::new(&row, &options);
|
||||||
assert_eq!(fmt.get_values(), vec!("26%"));
|
assert_eq!(fmt.get_values(), vec!("26%"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_row_formatter_with_round_up_byte_values() {
|
||||||
|
fn get_formatted_values(bytes: u64, bytes_used: u64, bytes_avail: u64) -> Vec<String> {
|
||||||
|
let options = Options {
|
||||||
|
block_size: BlockSize::Bytes(1000),
|
||||||
|
columns: vec![Column::Size, Column::Used, Column::Avail],
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
|
|
||||||
|
let row = Row {
|
||||||
|
bytes,
|
||||||
|
bytes_used,
|
||||||
|
bytes_avail,
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
|
RowFormatter::new(&row, &options).get_values()
|
||||||
|
}
|
||||||
|
|
||||||
|
assert_eq!(get_formatted_values(100, 100, 0), vec!("1", "1", "0"));
|
||||||
|
assert_eq!(get_formatted_values(100, 99, 1), vec!("1", "1", "1"));
|
||||||
|
assert_eq!(get_formatted_values(1000, 1000, 0), vec!("1", "1", "0"));
|
||||||
|
assert_eq!(get_formatted_values(1001, 1000, 1), vec!("2", "1", "1"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -187,6 +187,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::FILE)
|
Arg::new(options::FILE)
|
||||||
.hide(true)
|
.hide(true)
|
||||||
|
.value_hint(clap::ValueHint::FilePath)
|
||||||
.multiple_occurrences(true),
|
.multiple_occurrences(true),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,5 +88,10 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.short('z')
|
.short('z')
|
||||||
.help("separate output with NUL rather than newline"),
|
.help("separate output with NUL rather than newline"),
|
||||||
)
|
)
|
||||||
.arg(Arg::new(options::DIR).hide(true).multiple_occurrences(true))
|
.arg(
|
||||||
|
Arg::new(options::DIR)
|
||||||
|
.hide(true)
|
||||||
|
.multiple_occurrences(true)
|
||||||
|
.value_hint(clap::ValueHint::AnyPath),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -884,6 +884,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.short('X')
|
.short('X')
|
||||||
.long("exclude-from")
|
.long("exclude-from")
|
||||||
.value_name("FILE")
|
.value_name("FILE")
|
||||||
|
.value_hint(clap::ValueHint::FilePath)
|
||||||
.help("exclude files that match any pattern in FILE")
|
.help("exclude files that match any pattern in FILE")
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
|
|
||||||
|
@ -913,6 +914,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::FILE)
|
Arg::new(options::FILE)
|
||||||
.hide(true)
|
.hide(true)
|
||||||
|
.value_hint(clap::ValueHint::AnyPath)
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -951,8 +953,10 @@ impl Threshold {
|
||||||
fn format_error_message(error: &ParseSizeError, s: &str, option: &str) -> String {
|
fn format_error_message(error: &ParseSizeError, s: &str, option: &str) -> String {
|
||||||
// NOTE:
|
// NOTE:
|
||||||
// GNU's du echos affected flag, -B or --block-size (-t or --threshold), depending user's selection
|
// GNU's du echos affected flag, -B or --block-size (-t or --threshold), depending user's selection
|
||||||
// GNU's du does distinguish between "invalid (suffix in) argument"
|
|
||||||
match error {
|
match error {
|
||||||
|
ParseSizeError::InvalidSuffix(_) => {
|
||||||
|
format!("invalid suffix in --{} argument {}", option, s.quote())
|
||||||
|
}
|
||||||
ParseSizeError::ParseFailure(_) => format!("invalid --{} argument {}", option, s.quote()),
|
ParseSizeError::ParseFailure(_) => format!("invalid --{} argument {}", option, s.quote()),
|
||||||
ParseSizeError::SizeTooBig(_) => format!("--{} argument {} too large", option, s.quote()),
|
ParseSizeError::SizeTooBig(_) => format!("--{} argument {} too large", option, s.quote()),
|
||||||
}
|
}
|
||||||
|
|
2
src/uu/env/src/env.rs
vendored
2
src/uu/env/src/env.rs
vendored
|
@ -144,6 +144,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.number_of_values(1)
|
.number_of_values(1)
|
||||||
.value_name("DIR")
|
.value_name("DIR")
|
||||||
|
.value_hint(clap::ValueHint::DirPath)
|
||||||
.help("change working directory to DIR"))
|
.help("change working directory to DIR"))
|
||||||
.arg(Arg::new("null")
|
.arg(Arg::new("null")
|
||||||
.short('0')
|
.short('0')
|
||||||
|
@ -156,6 +157,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.number_of_values(1)
|
.number_of_values(1)
|
||||||
.value_name("PATH")
|
.value_name("PATH")
|
||||||
|
.value_hint(clap::ValueHint::FilePath)
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
.help("read and set variables from a \".env\"-style configuration file (prior to any \
|
.help("read and set variables from a \".env\"-style configuration file (prior to any \
|
||||||
unset and/or set)"))
|
unset and/or set)"))
|
||||||
|
|
|
@ -207,6 +207,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
.hide(true)
|
.hide(true)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
|
.value_hint(clap::ValueHint::FilePath)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -344,6 +344,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(ARG_FILES)
|
Arg::new(ARG_FILES)
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
.takes_value(true),
|
.takes_value(true)
|
||||||
|
.value_hint(clap::ValueHint::FilePath),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,14 +99,15 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::FILE)
|
Arg::new(options::FILE)
|
||||||
.hide(true)
|
.hide(true)
|
||||||
.multiple_occurrences(true),
|
.multiple_occurrences(true)
|
||||||
|
.value_hint(clap::ValueHint::FilePath),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_obsolete(args: &[String]) -> (Vec<String>, Option<String>) {
|
fn handle_obsolete(args: &[String]) -> (Vec<String>, Option<String>) {
|
||||||
for (i, arg) in args.iter().enumerate() {
|
for (i, arg) in args.iter().enumerate() {
|
||||||
let slice = &arg;
|
let slice = &arg;
|
||||||
if slice.starts_with('-') && slice.chars().nth(1).map_or(false, |c| c.is_digit(10)) {
|
if slice.starts_with('-') && slice.chars().nth(1).map_or(false, |c| c.is_ascii_digit()) {
|
||||||
let mut v = args.to_vec();
|
let mut v = args.to_vec();
|
||||||
v.remove(i);
|
v.remove(i);
|
||||||
return (v, Some(slice[1..].to_owned()));
|
return (v, Some(slice[1..].to_owned()));
|
||||||
|
|
|
@ -112,6 +112,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
Arg::new(options::USERS)
|
Arg::new(options::USERS)
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.value_name(options::USERS),
|
.value_name(options::USERS)
|
||||||
|
.value_hint(clap::ValueHint::Username),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -423,6 +423,7 @@ pub fn uu_app_common<'a>() -> Command<'a> {
|
||||||
.index(1)
|
.index(1)
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
.value_name("FILE")
|
.value_name("FILE")
|
||||||
|
.value_hint(clap::ValueHint::FilePath)
|
||||||
.allow_invalid_utf8(true),
|
.allow_invalid_utf8(true),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,7 +107,11 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.help("line delimiter is NUL, not newline")
|
.help("line delimiter is NUL, not newline")
|
||||||
.overrides_with(options::ZERO_NAME),
|
.overrides_with(options::ZERO_NAME),
|
||||||
)
|
)
|
||||||
.arg(Arg::new(options::FILES_NAME).multiple_occurrences(true))
|
.arg(
|
||||||
|
Arg::new(options::FILES_NAME)
|
||||||
|
.multiple_occurrences(true)
|
||||||
|
.value_hint(clap::ValueHint::FilePath),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
|
|
|
@ -20,7 +20,7 @@ pub fn parse_obsolete(src: &str) -> Option<Result<impl Iterator<Item = OsString>
|
||||||
let mut has_num = false;
|
let mut has_num = false;
|
||||||
let mut last_char = 0 as char;
|
let mut last_char = 0 as char;
|
||||||
for (n, c) in &mut chars {
|
for (n, c) in &mut chars {
|
||||||
if c.is_digit(10) {
|
if c.is_ascii_digit() {
|
||||||
has_num = true;
|
has_num = true;
|
||||||
num_end = n;
|
num_end = n;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -16,7 +16,7 @@ path = "src/hostid.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "3.1", features = ["wrap_help", "cargo"] }
|
clap = { version = "3.1", features = ["wrap_help", "cargo"] }
|
||||||
libc = "0.2.125"
|
libc = "0.2.126"
|
||||||
uucore = { version=">=0.0.11", package="uucore", path="../../uucore" }
|
uucore = { version=">=0.0.11", package="uucore", path="../../uucore" }
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
|
|
|
@ -105,7 +105,11 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.overrides_with_all(&[OPT_DOMAIN, OPT_IP_ADDRESS, OPT_FQDN, OPT_SHORT])
|
.overrides_with_all(&[OPT_DOMAIN, OPT_IP_ADDRESS, OPT_FQDN, OPT_SHORT])
|
||||||
.help("Display the short hostname (the portion before the first dot) if possible"),
|
.help("Display the short hostname (the portion before the first dot) if possible"),
|
||||||
)
|
)
|
||||||
.arg(Arg::new(OPT_HOST).allow_invalid_utf8(true))
|
.arg(
|
||||||
|
Arg::new(OPT_HOST)
|
||||||
|
.allow_invalid_utf8(true)
|
||||||
|
.value_hint(clap::ValueHint::Hostname),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn display_hostname(matches: &ArgMatches) -> UResult<()> {
|
fn display_hostname(matches: &ArgMatches) -> UResult<()> {
|
||||||
|
|
|
@ -443,7 +443,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
Arg::new(options::ARG_USERS)
|
Arg::new(options::ARG_USERS)
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.value_name(options::ARG_USERS),
|
.value_name(options::ARG_USERS)
|
||||||
|
.value_hint(clap::ValueHint::Username),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -248,6 +248,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.help("set ownership (super-user only)")
|
.help("set ownership (super-user only)")
|
||||||
.value_name("OWNER")
|
.value_name("OWNER")
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
|
.value_hint(clap::ValueHint::Username)
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(OPT_PRESERVE_TIMESTAMPS)
|
Arg::new(OPT_PRESERVE_TIMESTAMPS)
|
||||||
|
@ -266,6 +267,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.long(OPT_STRIP_PROGRAM)
|
.long(OPT_STRIP_PROGRAM)
|
||||||
.help("program used to strip binaries (no action Windows)")
|
.help("program used to strip binaries (no action Windows)")
|
||||||
.value_name("PROGRAM")
|
.value_name("PROGRAM")
|
||||||
|
.value_hint(clap::ValueHint::CommandName)
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
backup_control::arguments::suffix()
|
backup_control::arguments::suffix()
|
||||||
|
@ -277,6 +279,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.long(OPT_TARGET_DIRECTORY)
|
.long(OPT_TARGET_DIRECTORY)
|
||||||
.help("move all SOURCE arguments into DIRECTORY")
|
.help("move all SOURCE arguments into DIRECTORY")
|
||||||
.value_name("DIRECTORY")
|
.value_name("DIRECTORY")
|
||||||
|
.value_hint(clap::ValueHint::DirPath)
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
// TODO implement flag
|
// TODO implement flag
|
||||||
|
@ -307,7 +310,13 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.help("(unimplemented) set security context of files and directories")
|
.help("(unimplemented) set security context of files and directories")
|
||||||
.value_name("CONTEXT")
|
.value_name("CONTEXT")
|
||||||
)
|
)
|
||||||
.arg(Arg::new(ARG_FILES).multiple_occurrences(true).takes_value(true).min_values(1))
|
.arg(
|
||||||
|
Arg::new(ARG_FILES)
|
||||||
|
.multiple_occurrences(true)
|
||||||
|
.takes_value(true)
|
||||||
|
.min_values(1)
|
||||||
|
.value_hint(clap::ValueHint::AnyPath)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Check for unimplemented command line arguments.
|
/// Check for unimplemented command line arguments.
|
||||||
|
|
|
@ -801,12 +801,14 @@ FILENUM is 1 or 2, corresponding to FILE1 or FILE2",
|
||||||
Arg::new("file1")
|
Arg::new("file1")
|
||||||
.required(true)
|
.required(true)
|
||||||
.value_name("FILE1")
|
.value_name("FILE1")
|
||||||
|
.value_hint(clap::ValueHint::FilePath)
|
||||||
.hide(true),
|
.hide(true),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new("file2")
|
Arg::new("file2")
|
||||||
.required(true)
|
.required(true)
|
||||||
.value_name("FILE2")
|
.value_name("FILE2")
|
||||||
|
.value_hint(clap::ValueHint::FilePath)
|
||||||
.hide(true),
|
.hide(true),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,6 +46,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.min_values(2)
|
.min_values(2)
|
||||||
.max_values(2)
|
.max_values(2)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
|
.value_hint(clap::ValueHint::AnyPath)
|
||||||
.allow_invalid_utf8(true),
|
.allow_invalid_utf8(true),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -232,6 +232,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.long(options::TARGET_DIRECTORY)
|
.long(options::TARGET_DIRECTORY)
|
||||||
.help("specify the DIRECTORY in which to create the links")
|
.help("specify the DIRECTORY in which to create the links")
|
||||||
.value_name("DIRECTORY")
|
.value_name("DIRECTORY")
|
||||||
|
.value_hint(clap::ValueHint::DirPath)
|
||||||
.conflicts_with(options::NO_TARGET_DIRECTORY),
|
.conflicts_with(options::NO_TARGET_DIRECTORY),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
|
@ -257,6 +258,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
Arg::new(ARG_FILES)
|
Arg::new(ARG_FILES)
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
|
.value_hint(clap::ValueHint::AnyPath)
|
||||||
.required(true)
|
.required(true)
|
||||||
.min_values(1),
|
.min_values(1),
|
||||||
)
|
)
|
||||||
|
|
|
@ -15,7 +15,7 @@ edition = "2021"
|
||||||
path = "src/logname.rs"
|
path = "src/logname.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
libc = "0.2.125"
|
libc = "0.2.126"
|
||||||
clap = { version = "3.1", features = ["wrap_help", "cargo"] }
|
clap = { version = "3.1", features = ["wrap_help", "cargo"] }
|
||||||
uucore = { version=">=0.0.11", package="uucore", path="../../uucore" }
|
uucore = { version=">=0.0.11", package="uucore", path="../../uucore" }
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ number_prefix = "0.4"
|
||||||
term_grid = "0.1.5"
|
term_grid = "0.1.5"
|
||||||
termsize = "0.1.6"
|
termsize = "0.1.6"
|
||||||
glob = "0.3.0"
|
glob = "0.3.0"
|
||||||
lscolors = { version = "0.9.0", features = ["ansi_term"] }
|
lscolors = { version = "0.10.0", features = ["ansi_term"] }
|
||||||
uucore = { version = ">=0.0.8", package = "uucore", path = "../../uucore", features = ["entries", "fs"] }
|
uucore = { version = ">=0.0.8", package = "uucore", path = "../../uucore", features = ["entries", "fs"] }
|
||||||
once_cell = "1.10.0"
|
once_cell = "1.10.0"
|
||||||
atty = "0.2"
|
atty = "0.2"
|
||||||
|
|
|
@ -28,7 +28,7 @@ use std::{
|
||||||
cmp::Reverse,
|
cmp::Reverse,
|
||||||
error::Error,
|
error::Error,
|
||||||
ffi::{OsStr, OsString},
|
ffi::{OsStr, OsString},
|
||||||
fmt::Display,
|
fmt::{Display, Write as FmtWrite},
|
||||||
fs::{self, DirEntry, FileType, Metadata, ReadDir},
|
fs::{self, DirEntry, FileType, Metadata, ReadDir},
|
||||||
io::{stdout, BufWriter, ErrorKind, Stdout, Write},
|
io::{stdout, BufWriter, ErrorKind, Stdout, Write},
|
||||||
path::{Path, PathBuf},
|
path::{Path, PathBuf},
|
||||||
|
@ -1402,7 +1402,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
Arg::new(options::PATHS)
|
Arg::new(options::PATHS)
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.allow_invalid_utf8(true),
|
.value_hint(clap::ValueHint::AnyPath)
|
||||||
|
.allow_invalid_utf8(true)
|
||||||
)
|
)
|
||||||
.after_help(
|
.after_help(
|
||||||
"The TIME_STYLE argument can be full-iso, long-iso, iso. \
|
"The TIME_STYLE argument can be full-iso, long-iso, iso. \
|
||||||
|
@ -1825,7 +1826,7 @@ fn display_additional_leading_info(
|
||||||
} else {
|
} else {
|
||||||
"?".to_owned()
|
"?".to_owned()
|
||||||
};
|
};
|
||||||
result.push_str(&format!("{} ", pad_left(&i, padding.inode)));
|
write!(result, "{} ", pad_left(&i, padding.inode)).unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1835,7 +1836,7 @@ fn display_additional_leading_info(
|
||||||
} else {
|
} else {
|
||||||
"?".to_owned()
|
"?".to_owned()
|
||||||
};
|
};
|
||||||
result.push_str(&format!("{} ", pad_left(&s, padding.block_size),));
|
write!(result, "{} ", pad_left(&s, padding.block_size)).unwrap();
|
||||||
}
|
}
|
||||||
Ok(result)
|
Ok(result)
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,7 +137,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.min_values(1)
|
.min_values(1)
|
||||||
.allow_invalid_utf8(true),
|
.allow_invalid_utf8(true)
|
||||||
|
.value_hint(clap::ValueHint::DirPath),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ path = "src/mkfifo.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "3.1", features = ["wrap_help", "cargo"] }
|
clap = { version = "3.1", features = ["wrap_help", "cargo"] }
|
||||||
libc = "0.2.125"
|
libc = "0.2.126"
|
||||||
uucore = { version=">=0.0.11", package="uucore", path="../../uucore" }
|
uucore = { version=">=0.0.11", package="uucore", path="../../uucore" }
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
|
|
|
@ -102,6 +102,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::FIFO)
|
Arg::new(options::FIFO)
|
||||||
.hide(true)
|
.hide(true)
|
||||||
.multiple_occurrences(true),
|
.multiple_occurrences(true)
|
||||||
|
.value_hint(clap::ValueHint::AnyPath),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ path = "src/mknod.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "3.1", features = ["wrap_help", "cargo"] }
|
clap = { version = "3.1", features = ["wrap_help", "cargo"] }
|
||||||
libc = "^0.2.125"
|
libc = "^0.2.126"
|
||||||
uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["mode"] }
|
uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["mode"] }
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
|
|
|
@ -162,7 +162,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.value_name("NAME")
|
.value_name("NAME")
|
||||||
.help("name of the new file")
|
.help("name of the new file")
|
||||||
.required(true)
|
.required(true)
|
||||||
.index(1),
|
.index(1)
|
||||||
|
.value_hint(clap::ValueHint::AnyPath),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new("type")
|
Arg::new("type")
|
||||||
|
|
|
@ -41,7 +41,12 @@ enum MkTempError {
|
||||||
PersistError(PathBuf),
|
PersistError(PathBuf),
|
||||||
MustEndInX(String),
|
MustEndInX(String),
|
||||||
TooFewXs(String),
|
TooFewXs(String),
|
||||||
ContainsDirSeparator(String),
|
|
||||||
|
/// The template prefix contains a path separator (e.g. `"a/bXXX"`).
|
||||||
|
PrefixContainsDirSeparator(String),
|
||||||
|
|
||||||
|
/// The template suffix contains a path separator (e.g. `"XXXa/b"`).
|
||||||
|
SuffixContainsDirSeparator(String),
|
||||||
InvalidTemplate(String),
|
InvalidTemplate(String),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +61,14 @@ impl Display for MkTempError {
|
||||||
PersistError(p) => write!(f, "could not persist file {}", p.quote()),
|
PersistError(p) => write!(f, "could not persist file {}", p.quote()),
|
||||||
MustEndInX(s) => write!(f, "with --suffix, template {} must end in X", s.quote()),
|
MustEndInX(s) => write!(f, "with --suffix, template {} must end in X", s.quote()),
|
||||||
TooFewXs(s) => write!(f, "too few X's in template {}", s.quote()),
|
TooFewXs(s) => write!(f, "too few X's in template {}", s.quote()),
|
||||||
ContainsDirSeparator(s) => {
|
PrefixContainsDirSeparator(s) => {
|
||||||
|
write!(
|
||||||
|
f,
|
||||||
|
"invalid template, {}, contains directory separator",
|
||||||
|
s.quote()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
SuffixContainsDirSeparator(s) => {
|
||||||
write!(
|
write!(
|
||||||
f,
|
f,
|
||||||
"invalid suffix {}, contains directory separator",
|
"invalid suffix {}, contains directory separator",
|
||||||
|
@ -190,7 +202,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
be an absolute name; unlike with -t, TEMPLATE may contain \
|
be an absolute name; unlike with -t, TEMPLATE may contain \
|
||||||
slashes, but mktemp creates only the final component",
|
slashes, but mktemp creates only the final component",
|
||||||
)
|
)
|
||||||
.value_name("DIR"),
|
.value_name("DIR")
|
||||||
|
.value_hint(clap::ValueHint::DirPath),
|
||||||
)
|
)
|
||||||
.arg(Arg::new(OPT_T).short('t').help(
|
.arg(Arg::new(OPT_T).short('t').help(
|
||||||
"Generate a template (using the supplied prefix and TMPDIR (TMP on windows) if set) \
|
"Generate a template (using the supplied prefix and TMPDIR (TMP on windows) if set) \
|
||||||
|
@ -252,8 +265,12 @@ fn parse_template<'a>(
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if prefix.chars().any(is_separator) {
|
||||||
|
return Err(MkTempError::PrefixContainsDirSeparator(temp.into()));
|
||||||
|
}
|
||||||
|
|
||||||
if suf.chars().any(is_separator) {
|
if suf.chars().any(is_separator) {
|
||||||
return Err(MkTempError::ContainsDirSeparator(suf.into()));
|
return Err(MkTempError::SuffixContainsDirSeparator(suf.into()));
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok((prefix, rand, suf))
|
Ok((prefix, rand, suf))
|
||||||
|
@ -352,11 +369,7 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_parse_template_errors() {
|
fn test_parse_template_errors() {
|
||||||
// TODO This should be an error as well, but we are not
|
assert!(parse_template("a/bXXX", None).is_err());
|
||||||
// catching it just yet. A future commit will correct this.
|
|
||||||
//
|
|
||||||
// assert!(parse_template("a/bXXX", None).is_err());
|
|
||||||
//
|
|
||||||
assert!(parse_template("XXXa/b", None).is_err());
|
assert!(parse_template("XXXa/b", None).is_err());
|
||||||
assert!(parse_template("XX", None).is_err());
|
assert!(parse_template("XX", None).is_err());
|
||||||
assert!(parse_template("XXXabc", Some("def")).is_err());
|
assert!(parse_template("XXXabc", Some("def")).is_err());
|
||||||
|
|
|
@ -183,7 +183,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
Arg::new(options::FILES)
|
Arg::new(options::FILES)
|
||||||
.required(false)
|
.required(false)
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
.help("Path to the files to be read"),
|
.help("Path to the files to be read")
|
||||||
|
.value_hint(clap::ValueHint::FilePath),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -156,14 +156,15 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.help("move all SOURCE arguments into DIRECTORY")
|
.help("move all SOURCE arguments into DIRECTORY")
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.value_name("DIRECTORY")
|
.value_name("DIRECTORY")
|
||||||
|
.value_hint(clap::ValueHint::DirPath)
|
||||||
.conflicts_with(OPT_NO_TARGET_DIRECTORY)
|
.conflicts_with(OPT_NO_TARGET_DIRECTORY)
|
||||||
.allow_invalid_utf8(true)
|
.allow_invalid_utf8(true)
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(OPT_NO_TARGET_DIRECTORY)
|
Arg::new(OPT_NO_TARGET_DIRECTORY)
|
||||||
.short('T')
|
.short('T')
|
||||||
.long(OPT_NO_TARGET_DIRECTORY).
|
.long(OPT_NO_TARGET_DIRECTORY)
|
||||||
help("treat DEST as a normal file")
|
.help("treat DEST as a normal file")
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(OPT_UPDATE)
|
Arg::new(OPT_UPDATE)
|
||||||
|
@ -183,6 +184,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.min_values(2)
|
.min_values(2)
|
||||||
.required(true)
|
.required(true)
|
||||||
.allow_invalid_utf8(true)
|
.allow_invalid_utf8(true)
|
||||||
|
.value_hint(clap::ValueHint::AnyPath)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ path = "src/nice.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "3.1", features = ["wrap_help", "cargo"] }
|
clap = { version = "3.1", features = ["wrap_help", "cargo"] }
|
||||||
libc = "0.2.125"
|
libc = "0.2.126"
|
||||||
nix = { version = "0.24.1", default-features = false }
|
nix = { version = "0.24.1", default-features = false }
|
||||||
uucore = { version=">=0.0.11", package="uucore", path="../../uucore" }
|
uucore = { version=">=0.0.11", package="uucore", path="../../uucore" }
|
||||||
|
|
||||||
|
|
|
@ -117,5 +117,9 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.allow_hyphen_values(true),
|
.allow_hyphen_values(true),
|
||||||
)
|
)
|
||||||
.arg(Arg::new(options::COMMAND).multiple_occurrences(true))
|
.arg(
|
||||||
|
Arg::new(options::COMMAND)
|
||||||
|
.multiple_occurrences(true)
|
||||||
|
.value_hint(clap::ValueHint::CommandName),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,7 +154,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::FILE)
|
Arg::new(options::FILE)
|
||||||
.hide(true)
|
.hide(true)
|
||||||
.multiple_occurrences(true),
|
.multiple_occurrences(true)
|
||||||
|
.value_hint(clap::ValueHint::FilePath),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::BODY_NUMBERING)
|
Arg::new(options::BODY_NUMBERING)
|
||||||
|
|
|
@ -16,7 +16,7 @@ path = "src/nohup.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "3.1", features = ["wrap_help", "cargo"] }
|
clap = { version = "3.1", features = ["wrap_help", "cargo"] }
|
||||||
libc = "0.2.125"
|
libc = "0.2.126"
|
||||||
atty = "0.2"
|
atty = "0.2"
|
||||||
uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["fs"] }
|
uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["fs"] }
|
||||||
|
|
||||||
|
|
|
@ -126,7 +126,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
Arg::new(options::CMD)
|
Arg::new(options::CMD)
|
||||||
.hide(true)
|
.hide(true)
|
||||||
.required(true)
|
.required(true)
|
||||||
.multiple_occurrences(true),
|
.multiple_occurrences(true)
|
||||||
|
.value_hint(clap::ValueHint::CommandName),
|
||||||
)
|
)
|
||||||
.trailing_var_arg(true)
|
.trailing_var_arg(true)
|
||||||
.infer_long_args(true)
|
.infer_long_args(true)
|
||||||
|
|
|
@ -15,7 +15,7 @@ edition = "2021"
|
||||||
path = "src/nproc.rs"
|
path = "src/nproc.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
libc = "0.2.125"
|
libc = "0.2.126"
|
||||||
num_cpus = "1.10"
|
num_cpus = "1.10"
|
||||||
clap = { version = "3.1", features = ["wrap_help", "cargo"] }
|
clap = { version = "3.1", features = ["wrap_help", "cargo"] }
|
||||||
uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["fs"] }
|
uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["fs"] }
|
||||||
|
|
|
@ -244,7 +244,7 @@ fn format_string(
|
||||||
p => format!(
|
p => format!(
|
||||||
"{:<padding$}",
|
"{:<padding$}",
|
||||||
number_with_suffix,
|
number_with_suffix,
|
||||||
padding = p.abs() as usize
|
padding = p.unsigned_abs()
|
||||||
),
|
),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@ mod prn_float;
|
||||||
mod prn_int;
|
mod prn_int;
|
||||||
|
|
||||||
use std::cmp;
|
use std::cmp;
|
||||||
|
use std::fmt::Write;
|
||||||
|
|
||||||
use crate::byteorder_io::*;
|
use crate::byteorder_io::*;
|
||||||
use crate::formatteriteminfo::*;
|
use crate::formatteriteminfo::*;
|
||||||
|
@ -512,7 +513,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::FILENAME)
|
Arg::new(options::FILENAME)
|
||||||
.hide(true)
|
.hide(true)
|
||||||
.multiple_occurrences(true),
|
.multiple_occurrences(true)
|
||||||
|
.value_hint(clap::ValueHint::FilePath),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -599,11 +601,13 @@ fn print_bytes(prefix: &str, input_decoder: &MemoryDecoder, output_info: &Output
|
||||||
|
|
||||||
let mut b = 0;
|
let mut b = 0;
|
||||||
while b < input_decoder.length() {
|
while b < input_decoder.length() {
|
||||||
output_text.push_str(&format!(
|
write!(
|
||||||
|
output_text,
|
||||||
"{:>width$}",
|
"{:>width$}",
|
||||||
"",
|
"",
|
||||||
width = f.spacing[b % output_info.byte_size_block]
|
width = f.spacing[b % output_info.byte_size_block]
|
||||||
));
|
)
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
match f.formatter_item_info.formatter {
|
match f.formatter_item_info.formatter {
|
||||||
FormatWriter::IntWriter(func) => {
|
FormatWriter::IntWriter(func) => {
|
||||||
|
@ -626,12 +630,14 @@ fn print_bytes(prefix: &str, input_decoder: &MemoryDecoder, output_info: &Output
|
||||||
let missing_spacing = output_info
|
let missing_spacing = output_info
|
||||||
.print_width_line
|
.print_width_line
|
||||||
.saturating_sub(output_text.chars().count());
|
.saturating_sub(output_text.chars().count());
|
||||||
output_text.push_str(&format!(
|
write!(
|
||||||
|
output_text,
|
||||||
"{:>width$} {}",
|
"{:>width$} {}",
|
||||||
"",
|
"",
|
||||||
format_ascii_dump(input_decoder.get_buffer(0)),
|
format_ascii_dump(input_decoder.get_buffer(0)),
|
||||||
width = missing_spacing
|
width = missing_spacing
|
||||||
));
|
)
|
||||||
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
if first {
|
if first {
|
||||||
|
@ -673,8 +679,10 @@ fn open_input_peek_reader(
|
||||||
fn format_error_message(error: &ParseSizeError, s: &str, option: &str) -> String {
|
fn format_error_message(error: &ParseSizeError, s: &str, option: &str) -> String {
|
||||||
// NOTE:
|
// NOTE:
|
||||||
// GNU's od echos affected flag, -N or --read-bytes (-j or --skip-bytes, etc.), depending user's selection
|
// GNU's od echos affected flag, -N or --read-bytes (-j or --skip-bytes, etc.), depending user's selection
|
||||||
// GNU's od does distinguish between "invalid (suffix in) argument"
|
|
||||||
match error {
|
match error {
|
||||||
|
ParseSizeError::InvalidSuffix(_) => {
|
||||||
|
format!("invalid suffix in --{} argument {}", option, s.quote())
|
||||||
|
}
|
||||||
ParseSizeError::ParseFailure(_) => format!("invalid --{} argument {}", option, s.quote()),
|
ParseSizeError::ParseFailure(_) => format!("invalid --{} argument {}", option, s.quote()),
|
||||||
ParseSizeError::SizeTooBig(_) => format!("--{} argument {} too large", option, s.quote()),
|
ParseSizeError::SizeTooBig(_) => format!("--{} argument {} too large", option, s.quote()),
|
||||||
}
|
}
|
||||||
|
|
|
@ -244,7 +244,7 @@ fn is_format_size_decimal(
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
match ch {
|
match ch {
|
||||||
Some(d) if d.is_digit(10) => {
|
Some(d) if d.is_ascii_digit() => {
|
||||||
decimal_size.push(d);
|
decimal_size.push(d);
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ pub trait CommandLineOpts {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Implementation for `getopts`
|
/// Implementation for `getopts`
|
||||||
impl<'a> CommandLineOpts for ArgMatches {
|
impl CommandLineOpts for ArgMatches {
|
||||||
fn inputs(&self) -> Vec<&str> {
|
fn inputs(&self) -> Vec<&str> {
|
||||||
self.values_of(options::FILENAME)
|
self.values_of(options::FILENAME)
|
||||||
.map(|values| values.collect())
|
.map(|values| values.collect())
|
||||||
|
|
|
@ -71,7 +71,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
Arg::new(options::FILE)
|
Arg::new(options::FILE)
|
||||||
.value_name("FILE")
|
.value_name("FILE")
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
.default_value("-"),
|
.default_value("-")
|
||||||
|
.value_hint(clap::ValueHint::FilePath),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ path = "src/pathchk.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "3.1", features = ["wrap_help", "cargo"] }
|
clap = { version = "3.1", features = ["wrap_help", "cargo"] }
|
||||||
libc = "0.2.125"
|
libc = "0.2.126"
|
||||||
uucore = { version=">=0.0.11", package="uucore", path="../../uucore" }
|
uucore = { version=">=0.0.11", package="uucore", path="../../uucore" }
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
|
|
|
@ -108,7 +108,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::PATH)
|
Arg::new(options::PATH)
|
||||||
.hide(true)
|
.hide(true)
|
||||||
.multiple_occurrences(true),
|
.multiple_occurrences(true)
|
||||||
|
.value_hint(clap::ValueHint::AnyPath),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -179,7 +179,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::USER)
|
Arg::new(options::USER)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.multiple_occurrences(true),
|
.multiple_occurrences(true)
|
||||||
|
.value_hint(clap::ValueHint::Username),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
// Redefine the help argument to not include the short flag
|
// Redefine the help argument to not include the short flag
|
||||||
|
|
|
@ -372,6 +372,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
Arg::new(options::FILES)
|
Arg::new(options::FILES)
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
.multiple_values(true)
|
.multiple_values(true)
|
||||||
|
.value_hint(clap::ValueHint::FilePath)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ use std::cmp;
|
||||||
use std::collections::{BTreeSet, HashMap, HashSet};
|
use std::collections::{BTreeSet, HashMap, HashSet};
|
||||||
use std::default::Default;
|
use std::default::Default;
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::fmt::{Display, Formatter};
|
use std::fmt::{Display, Formatter, Write as FmtWrite};
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::io::{stdin, stdout, BufRead, BufReader, BufWriter, Read, Write};
|
use std::io::{stdin, stdout, BufRead, BufReader, BufWriter, Read, Write};
|
||||||
use std::num::ParseIntError;
|
use std::num::ParseIntError;
|
||||||
|
@ -572,7 +572,7 @@ fn format_tex_line(
|
||||||
reference: &str,
|
reference: &str,
|
||||||
) -> String {
|
) -> String {
|
||||||
let mut output = String::new();
|
let mut output = String::new();
|
||||||
output.push_str(&format!("\\{} ", config.macro_name));
|
write!(output, "\\{} ", config.macro_name).unwrap();
|
||||||
let all_before = if config.input_ref {
|
let all_before = if config.input_ref {
|
||||||
let before = &line[0..word_ref.position];
|
let before = &line[0..word_ref.position];
|
||||||
let before_start_trim_offset =
|
let before_start_trim_offset =
|
||||||
|
@ -587,18 +587,18 @@ fn format_tex_line(
|
||||||
let after_chars_trim_idx = (word_ref.position_end, chars_line.len());
|
let after_chars_trim_idx = (word_ref.position_end, chars_line.len());
|
||||||
let all_after = &chars_line[after_chars_trim_idx.0..after_chars_trim_idx.1];
|
let all_after = &chars_line[after_chars_trim_idx.0..after_chars_trim_idx.1];
|
||||||
let (tail, before, after, head) = get_output_chunks(all_before, keyword, all_after, config);
|
let (tail, before, after, head) = get_output_chunks(all_before, keyword, all_after, config);
|
||||||
output.push_str(&format!(
|
write!(
|
||||||
"{5}{0}{6}{5}{1}{6}{5}{2}{6}{5}{3}{6}{5}{4}{6}",
|
output,
|
||||||
|
"{{{0}}}{{{1}}}{{{2}}}{{{3}}}{{{4}}}",
|
||||||
format_tex_field(&tail),
|
format_tex_field(&tail),
|
||||||
format_tex_field(&before),
|
format_tex_field(&before),
|
||||||
format_tex_field(keyword),
|
format_tex_field(keyword),
|
||||||
format_tex_field(&after),
|
format_tex_field(&after),
|
||||||
format_tex_field(&head),
|
format_tex_field(&head),
|
||||||
"{",
|
)
|
||||||
"}"
|
.unwrap();
|
||||||
));
|
|
||||||
if config.auto_ref || config.input_ref {
|
if config.auto_ref || config.input_ref {
|
||||||
output.push_str(&format!("{}{}{}", "{", format_tex_field(reference), "}"));
|
write!(output, "{{{}}}", format_tex_field(reference)).unwrap();
|
||||||
}
|
}
|
||||||
output
|
output
|
||||||
}
|
}
|
||||||
|
@ -615,7 +615,7 @@ fn format_roff_line(
|
||||||
reference: &str,
|
reference: &str,
|
||||||
) -> String {
|
) -> String {
|
||||||
let mut output = String::new();
|
let mut output = String::new();
|
||||||
output.push_str(&format!(".{}", config.macro_name));
|
write!(output, ".{}", config.macro_name).unwrap();
|
||||||
let all_before = if config.input_ref {
|
let all_before = if config.input_ref {
|
||||||
let before = &line[0..word_ref.position];
|
let before = &line[0..word_ref.position];
|
||||||
let before_start_trim_offset =
|
let before_start_trim_offset =
|
||||||
|
@ -630,16 +630,18 @@ fn format_roff_line(
|
||||||
let after_chars_trim_idx = (word_ref.position_end, chars_line.len());
|
let after_chars_trim_idx = (word_ref.position_end, chars_line.len());
|
||||||
let all_after = &chars_line[after_chars_trim_idx.0..after_chars_trim_idx.1];
|
let all_after = &chars_line[after_chars_trim_idx.0..after_chars_trim_idx.1];
|
||||||
let (tail, before, after, head) = get_output_chunks(all_before, keyword, all_after, config);
|
let (tail, before, after, head) = get_output_chunks(all_before, keyword, all_after, config);
|
||||||
output.push_str(&format!(
|
write!(
|
||||||
|
output,
|
||||||
" \"{}\" \"{}\" \"{}{}\" \"{}\"",
|
" \"{}\" \"{}\" \"{}{}\" \"{}\"",
|
||||||
format_roff_field(&tail),
|
format_roff_field(&tail),
|
||||||
format_roff_field(&before),
|
format_roff_field(&before),
|
||||||
format_roff_field(keyword),
|
format_roff_field(keyword),
|
||||||
format_roff_field(&after),
|
format_roff_field(&after),
|
||||||
format_roff_field(&head)
|
format_roff_field(&head)
|
||||||
));
|
)
|
||||||
|
.unwrap();
|
||||||
if config.auto_ref || config.input_ref {
|
if config.auto_ref || config.input_ref {
|
||||||
output.push_str(&format!(" \"{}\"", format_roff_field(reference)));
|
write!(output, " \"{}\"", format_roff_field(reference)).unwrap();
|
||||||
}
|
}
|
||||||
output
|
output
|
||||||
}
|
}
|
||||||
|
@ -754,7 +756,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::FILE)
|
Arg::new(options::FILE)
|
||||||
.hide(true)
|
.hide(true)
|
||||||
.multiple_occurrences(true),
|
.multiple_occurrences(true)
|
||||||
|
.value_hint(clap::ValueHint::FilePath),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::AUTO_REFERENCE)
|
Arg::new(options::AUTO_REFERENCE)
|
||||||
|
@ -826,7 +829,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.long(options::BREAK_FILE)
|
.long(options::BREAK_FILE)
|
||||||
.help("word break characters in this FILE")
|
.help("word break characters in this FILE")
|
||||||
.value_name("FILE")
|
.value_name("FILE")
|
||||||
.takes_value(true),
|
.takes_value(true)
|
||||||
|
.value_hint(clap::ValueHint::FilePath),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::IGNORE_CASE)
|
Arg::new(options::IGNORE_CASE)
|
||||||
|
@ -849,7 +853,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.long(options::IGNORE_FILE)
|
.long(options::IGNORE_FILE)
|
||||||
.help("read ignore word list from FILE")
|
.help("read ignore word list from FILE")
|
||||||
.value_name("FILE")
|
.value_name("FILE")
|
||||||
.takes_value(true),
|
.takes_value(true)
|
||||||
|
.value_hint(clap::ValueHint::FilePath),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::ONLY_FILE)
|
Arg::new(options::ONLY_FILE)
|
||||||
|
@ -857,7 +862,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.long(options::ONLY_FILE)
|
.long(options::ONLY_FILE)
|
||||||
.help("read only word list from this FILE")
|
.help("read only word list from this FILE")
|
||||||
.value_name("FILE")
|
.value_name("FILE")
|
||||||
.takes_value(true),
|
.takes_value(true)
|
||||||
|
.value_hint(clap::ValueHint::FilePath),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::REFERENCES)
|
Arg::new(options::REFERENCES)
|
||||||
|
|
|
@ -161,7 +161,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(ARG_FILES)
|
Arg::new(ARG_FILES)
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
.takes_value(true),
|
.takes_value(true)
|
||||||
|
.value_hint(clap::ValueHint::AnyPath),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -130,7 +130,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.required(true)
|
.required(true)
|
||||||
.min_values(1),
|
.min_values(1)
|
||||||
|
.value_hint(clap::ValueHint::AnyPath),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -87,6 +87,15 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.arg(Arg::new(options::DIR).short('d').takes_value(true).help(
|
.arg(Arg::new(options::DIR).short('d').takes_value(true).help(
|
||||||
"If any of FROM and TO is not subpath of DIR, output absolute path instead of relative",
|
"If any of FROM and TO is not subpath of DIR, output absolute path instead of relative",
|
||||||
))
|
))
|
||||||
.arg(Arg::new(options::TO).required(true).takes_value(true))
|
.arg(
|
||||||
.arg(Arg::new(options::FROM).takes_value(true))
|
Arg::new(options::TO)
|
||||||
|
.required(true)
|
||||||
|
.takes_value(true)
|
||||||
|
.value_hint(clap::ValueHint::AnyPath),
|
||||||
|
)
|
||||||
|
.arg(
|
||||||
|
Arg::new(options::FROM)
|
||||||
|
.takes_value(true)
|
||||||
|
.value_hint(clap::ValueHint::AnyPath),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -227,6 +227,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.min_values(1)
|
.min_values(1)
|
||||||
|
.value_hint(clap::ValueHint::AnyPath)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ path = "src/rmdir.rs"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "3.1", features = ["wrap_help", "cargo"] }
|
clap = { version = "3.1", features = ["wrap_help", "cargo"] }
|
||||||
uucore = { version=">=0.0.11", package="uucore", path="../../uucore" }
|
uucore = { version=">=0.0.11", package="uucore", path="../../uucore" }
|
||||||
libc = "0.2.125"
|
libc = "0.2.126"
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "rmdir"
|
name = "rmdir"
|
||||||
|
|
|
@ -197,6 +197,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.min_values(1)
|
.min_values(1)
|
||||||
.required(true)
|
.required(true)
|
||||||
.allow_invalid_utf8(true),
|
.allow_invalid_utf8(true)
|
||||||
|
.value_hint(clap::ValueHint::DirPath),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -156,7 +156,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new("ARG")
|
Arg::new("ARG")
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
.allow_invalid_utf8(true),
|
.allow_invalid_utf8(true)
|
||||||
|
.value_hint(clap::ValueHint::CommandName),
|
||||||
)
|
)
|
||||||
// Once "ARG" is parsed, everything after that belongs to it.
|
// Once "ARG" is parsed, everything after that belongs to it.
|
||||||
//
|
//
|
||||||
|
|
|
@ -374,7 +374,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::FILE)
|
Arg::new(options::FILE)
|
||||||
.hide(true)
|
.hide(true)
|
||||||
.multiple_occurrences(true),
|
.multiple_occurrences(true)
|
||||||
|
.value_hint(clap::ValueHint::FilePath),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -158,14 +158,16 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.long(options::OUTPUT)
|
.long(options::OUTPUT)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.value_name("FILE")
|
.value_name("FILE")
|
||||||
.help("write result to FILE instead of standard output"),
|
.help("write result to FILE instead of standard output")
|
||||||
|
.value_hint(clap::ValueHint::FilePath),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::RANDOM_SOURCE)
|
Arg::new(options::RANDOM_SOURCE)
|
||||||
.long(options::RANDOM_SOURCE)
|
.long(options::RANDOM_SOURCE)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.value_name("FILE")
|
.value_name("FILE")
|
||||||
.help("get random bytes from FILE"),
|
.help("get random bytes from FILE")
|
||||||
|
.value_hint(clap::ValueHint::FilePath),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::REPEAT)
|
Arg::new(options::REPEAT)
|
||||||
|
@ -179,7 +181,11 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.long(options::ZERO_TERMINATED)
|
.long(options::ZERO_TERMINATED)
|
||||||
.help("line delimiter is NUL, not newline"),
|
.help("line delimiter is NUL, not newline"),
|
||||||
)
|
)
|
||||||
.arg(Arg::new(options::FILE).takes_value(true))
|
.arg(
|
||||||
|
Arg::new(options::FILE)
|
||||||
|
.takes_value(true)
|
||||||
|
.value_hint(clap::ValueHint::FilePath),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn read_input_file(filename: &str) -> UResult<Vec<u8>> {
|
fn read_input_file(filename: &str) -> UResult<Vec<u8>> {
|
||||||
|
|
|
@ -348,9 +348,9 @@ impl GlobalSettings {
|
||||||
];
|
];
|
||||||
let mut size_string = input.trim().to_string();
|
let mut size_string = input.trim().to_string();
|
||||||
|
|
||||||
if size_string.ends_with(|c: char| ALLOW_LIST.contains(&c) || c.is_digit(10)) {
|
if size_string.ends_with(|c: char| ALLOW_LIST.contains(&c) || c.is_ascii_digit()) {
|
||||||
// b 1, K 1024 (default)
|
// b 1, K 1024 (default)
|
||||||
if size_string.ends_with(|c: char| c.is_digit(10)) {
|
if size_string.ends_with(|c: char| c.is_ascii_digit()) {
|
||||||
size_string.push('K');
|
size_string.push('K');
|
||||||
} else if size_string.ends_with('b') {
|
} else if size_string.ends_with('b') {
|
||||||
size_string.pop();
|
size_string.pop();
|
||||||
|
@ -362,8 +362,10 @@ impl GlobalSettings {
|
||||||
size
|
size
|
||||||
))
|
))
|
||||||
})
|
})
|
||||||
|
} else if size_string.starts_with(|c: char| c.is_ascii_digit()) {
|
||||||
|
Err(ParseSizeError::InvalidSuffix("invalid suffix".to_string()))
|
||||||
} else {
|
} else {
|
||||||
Err(ParseSizeError::ParseFailure("invalid suffix".to_string()))
|
Err(ParseSizeError::ParseFailure("parse failure".to_string()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1397,7 +1399,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.long(options::OUTPUT)
|
.long(options::OUTPUT)
|
||||||
.help("write output to FILENAME instead of stdout")
|
.help("write output to FILENAME instead of stdout")
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.value_name("FILENAME"),
|
.value_name("FILENAME")
|
||||||
|
.value_hint(clap::ValueHint::FilePath),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::REVERSE)
|
Arg::new(options::REVERSE)
|
||||||
|
@ -1461,13 +1464,15 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.long(options::TMP_DIR)
|
.long(options::TMP_DIR)
|
||||||
.help("use DIR for temporaries, not $TMPDIR or /tmp")
|
.help("use DIR for temporaries, not $TMPDIR or /tmp")
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.value_name("DIR"),
|
.value_name("DIR")
|
||||||
|
.value_hint(clap::ValueHint::DirPath),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::COMPRESS_PROG)
|
Arg::new(options::COMPRESS_PROG)
|
||||||
.long(options::COMPRESS_PROG)
|
.long(options::COMPRESS_PROG)
|
||||||
.help("compress temporary files with PROG, decompress with PROG -d; PROG has to take input from stdin and output to stdout")
|
.help("compress temporary files with PROG, decompress with PROG -d; PROG has to take input from stdin and output to stdout")
|
||||||
.value_name("PROG"),
|
.value_name("PROG")
|
||||||
|
.value_hint(clap::ValueHint::CommandName),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::BATCH_SIZE)
|
Arg::new(options::BATCH_SIZE)
|
||||||
|
@ -1482,7 +1487,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.value_name("NUL_FILES")
|
.value_name("NUL_FILES")
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
.allow_invalid_utf8(true),
|
.allow_invalid_utf8(true)
|
||||||
|
.value_hint(clap::ValueHint::FilePath),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::DEBUG)
|
Arg::new(options::DEBUG)
|
||||||
|
@ -1493,7 +1499,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
Arg::new(options::FILES)
|
Arg::new(options::FILES)
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.allow_invalid_utf8(true),
|
.allow_invalid_utf8(true)
|
||||||
|
.value_hint(clap::ValueHint::FilePath),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1828,8 +1835,10 @@ fn open(path: impl AsRef<OsStr>) -> UResult<Box<dyn Read + Send>> {
|
||||||
fn format_error_message(error: &ParseSizeError, s: &str, option: &str) -> String {
|
fn format_error_message(error: &ParseSizeError, s: &str, option: &str) -> String {
|
||||||
// NOTE:
|
// NOTE:
|
||||||
// GNU's sort echos affected flag, -S or --buffer-size, depending user's selection
|
// GNU's sort echos affected flag, -S or --buffer-size, depending user's selection
|
||||||
// GNU's sort does distinguish between "invalid (suffix in) argument"
|
|
||||||
match error {
|
match error {
|
||||||
|
ParseSizeError::InvalidSuffix(_) => {
|
||||||
|
format!("invalid suffix in --{} argument {}", option, s.quote())
|
||||||
|
}
|
||||||
ParseSizeError::ParseFailure(_) => format!("invalid --{} argument {}", option, s.quote()),
|
ParseSizeError::ParseFailure(_) => format!("invalid --{} argument {}", option, s.quote()),
|
||||||
ParseSizeError::SizeTooBig(_) => format!("--{} argument {} too large", option, s.quote()),
|
ParseSizeError::SizeTooBig(_) => format!("--{} argument {} too large", option, s.quote()),
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,9 +111,11 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
Arg::new(OPT_FILTER)
|
Arg::new(OPT_FILTER)
|
||||||
.long(OPT_FILTER)
|
.long(OPT_FILTER)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
|
.value_name("COMMAND")
|
||||||
|
.value_hint(clap::ValueHint::CommandName)
|
||||||
.help(
|
.help(
|
||||||
"write to shell COMMAND file name is $FILE (Currently not implemented for Windows)",
|
"write to shell COMMAND; file name is $FILE (Currently not implemented for Windows)",
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(OPT_ELIDE_EMPTY_FILES)
|
Arg::new(OPT_ELIDE_EMPTY_FILES)
|
||||||
|
@ -162,7 +164,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
Arg::new(ARG_INPUT)
|
Arg::new(ARG_INPUT)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.default_value("-")
|
.default_value("-")
|
||||||
.index(1),
|
.index(1)
|
||||||
|
.value_hint(clap::ValueHint::FilePath),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(ARG_PREFIX)
|
Arg::new(ARG_PREFIX)
|
||||||
|
|
|
@ -19,7 +19,9 @@ use uucore::{entries, format_usage};
|
||||||
use clap::{crate_version, Arg, ArgMatches, Command};
|
use clap::{crate_version, Arg, ArgMatches, Command};
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use std::convert::AsRef;
|
use std::convert::AsRef;
|
||||||
|
use std::ffi::{OsStr, OsString};
|
||||||
use std::os::unix::fs::{FileTypeExt, MetadataExt};
|
use std::os::unix::fs::{FileTypeExt, MetadataExt};
|
||||||
|
use std::os::unix::prelude::OsStrExt;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::{cmp, fs, iter};
|
use std::{cmp, fs, iter};
|
||||||
|
|
||||||
|
@ -195,8 +197,8 @@ impl ScanUtil for str {
|
||||||
|
|
||||||
pub fn group_num(s: &str) -> Cow<str> {
|
pub fn group_num(s: &str) -> Cow<str> {
|
||||||
let is_negative = s.starts_with('-');
|
let is_negative = s.starts_with('-');
|
||||||
assert!(is_negative || s.chars().take(1).all(|c| c.is_digit(10)));
|
assert!(is_negative || s.chars().take(1).all(|c| c.is_ascii_digit()));
|
||||||
assert!(s.chars().skip(1).all(|c| c.is_digit(10)));
|
assert!(s.chars().skip(1).all(|c| c.is_ascii_digit()));
|
||||||
if s.len() < 4 {
|
if s.len() < 4 {
|
||||||
return s.into();
|
return s.into();
|
||||||
}
|
}
|
||||||
|
@ -221,7 +223,7 @@ pub struct Stater {
|
||||||
follow: bool,
|
follow: bool,
|
||||||
show_fs: bool,
|
show_fs: bool,
|
||||||
from_user: bool,
|
from_user: bool,
|
||||||
files: Vec<String>,
|
files: Vec<OsString>,
|
||||||
mount_list: Option<Vec<String>>,
|
mount_list: Option<Vec<String>>,
|
||||||
default_tokens: Vec<Token>,
|
default_tokens: Vec<Token>,
|
||||||
default_dev_tokens: Vec<Token>,
|
default_dev_tokens: Vec<Token>,
|
||||||
|
@ -471,24 +473,10 @@ impl Stater {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn new(matches: &ArgMatches) -> UResult<Self> {
|
fn new(matches: &ArgMatches) -> UResult<Self> {
|
||||||
let mut files: Vec<String> = matches
|
let files = matches
|
||||||
.values_of(ARG_FILES)
|
.values_of_os(ARG_FILES)
|
||||||
.map(|v| v.map(ToString::to_string).collect())
|
.map(|v| v.map(OsString::from).collect())
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
#[cfg(unix)]
|
|
||||||
if files.contains(&String::from("-")) {
|
|
||||||
let redirected_path = Path::new("/dev/stdin")
|
|
||||||
.canonicalize()
|
|
||||||
.expect("unable to canonicalize /dev/stdin")
|
|
||||||
.into_os_string()
|
|
||||||
.into_string()
|
|
||||||
.unwrap();
|
|
||||||
for file in &mut files {
|
|
||||||
if file == "-" {
|
|
||||||
*file = redirected_path.clone();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
let format_str = if matches.is_present(options::PRINTF) {
|
let format_str = if matches.is_present(options::PRINTF) {
|
||||||
matches
|
matches
|
||||||
.value_of(options::PRINTF)
|
.value_of(options::PRINTF)
|
||||||
|
@ -550,19 +538,37 @@ impl Stater {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn exec(&self) -> i32 {
|
fn exec(&self) -> i32 {
|
||||||
|
let mut stdin_is_fifo = false;
|
||||||
|
if cfg!(unix) {
|
||||||
|
if let Ok(md) = fs::metadata("/dev/stdin") {
|
||||||
|
stdin_is_fifo = md.file_type().is_fifo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let mut ret = 0;
|
let mut ret = 0;
|
||||||
for f in &self.files {
|
for f in &self.files {
|
||||||
ret |= self.do_stat(f.as_str());
|
ret |= self.do_stat(f, stdin_is_fifo);
|
||||||
}
|
}
|
||||||
ret
|
ret
|
||||||
}
|
}
|
||||||
|
|
||||||
fn do_stat(&self, file: &str) -> i32 {
|
fn do_stat(&self, file: &OsStr, stdin_is_fifo: bool) -> i32 {
|
||||||
if !self.show_fs {
|
let display_name = file.to_string_lossy();
|
||||||
let result = if self.follow {
|
let file: OsString = if cfg!(unix) && display_name.eq("-") {
|
||||||
fs::metadata(file)
|
if let Ok(p) = Path::new("/dev/stdin").canonicalize() {
|
||||||
|
p.into_os_string()
|
||||||
} else {
|
} else {
|
||||||
fs::symlink_metadata(file)
|
OsString::from("/dev/stdin")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
OsString::from(file)
|
||||||
|
};
|
||||||
|
|
||||||
|
if !self.show_fs {
|
||||||
|
let result = if self.follow || stdin_is_fifo && display_name.eq("-") {
|
||||||
|
fs::metadata(&file)
|
||||||
|
} else {
|
||||||
|
fs::symlink_metadata(&file)
|
||||||
};
|
};
|
||||||
match result {
|
match result {
|
||||||
Ok(meta) => {
|
Ok(meta) => {
|
||||||
|
@ -658,28 +664,32 @@ impl Stater {
|
||||||
|
|
||||||
// mount point
|
// mount point
|
||||||
'm' => {
|
'm' => {
|
||||||
arg = self.find_mount_point(file).unwrap();
|
arg = self.find_mount_point(&file).unwrap();
|
||||||
output_type = OutputType::Str;
|
output_type = OutputType::Str;
|
||||||
}
|
}
|
||||||
|
|
||||||
// file name
|
// file name
|
||||||
'n' => {
|
'n' => {
|
||||||
arg = file.to_owned();
|
arg = display_name.to_string();
|
||||||
output_type = OutputType::Str;
|
output_type = OutputType::Str;
|
||||||
}
|
}
|
||||||
// quoted file name with dereference if symbolic link
|
// quoted file name with dereference if symbolic link
|
||||||
'N' => {
|
'N' => {
|
||||||
if file_type.is_symlink() {
|
if file_type.is_symlink() {
|
||||||
let dst = match fs::read_link(file) {
|
let dst = match fs::read_link(&file) {
|
||||||
Ok(path) => path,
|
Ok(path) => path,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
println!("{}", e);
|
println!("{}", e);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
arg = format!("{} -> {}", file.quote(), dst.quote());
|
arg = format!(
|
||||||
|
"{} -> {}",
|
||||||
|
display_name.quote(),
|
||||||
|
dst.quote()
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
arg = file.to_string();
|
arg = display_name.to_string();
|
||||||
}
|
}
|
||||||
output_type = OutputType::Str;
|
output_type = OutputType::Str;
|
||||||
}
|
}
|
||||||
|
@ -771,12 +781,16 @@ impl Stater {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
show_error!("cannot stat {}: {}", file.quote(), e);
|
show_error!("cannot stat {}: {}", display_name.quote(), e);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
match statfs(file) {
|
#[cfg(unix)]
|
||||||
|
let p = file.as_bytes();
|
||||||
|
#[cfg(not(unix))]
|
||||||
|
let p = file.into_string().unwrap();
|
||||||
|
match statfs(p) {
|
||||||
Ok(meta) => {
|
Ok(meta) => {
|
||||||
let tokens = &self.default_tokens;
|
let tokens = &self.default_tokens;
|
||||||
|
|
||||||
|
@ -829,7 +843,7 @@ impl Stater {
|
||||||
}
|
}
|
||||||
// file name
|
// file name
|
||||||
'n' => {
|
'n' => {
|
||||||
arg = file.to_owned();
|
arg = display_name.to_string();
|
||||||
output_type = OutputType::Str;
|
output_type = OutputType::Str;
|
||||||
}
|
}
|
||||||
// block size (for faster transfers)
|
// block size (for faster transfers)
|
||||||
|
@ -866,7 +880,7 @@ impl Stater {
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
show_error!(
|
show_error!(
|
||||||
"cannot read file system information for {}: {}",
|
"cannot read file system information for {}: {}",
|
||||||
file.quote(),
|
display_name.quote(),
|
||||||
e
|
e
|
||||||
);
|
);
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -1028,6 +1042,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
Arg::new(ARG_FILES)
|
Arg::new(ARG_FILES)
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.min_values(1),
|
.allow_invalid_utf8(true)
|
||||||
|
.min_values(1)
|
||||||
|
.value_hint(clap::ValueHint::FilePath),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ struct ProgramOptions {
|
||||||
stderr: BufferType,
|
stderr: BufferType,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> TryFrom<&ArgMatches> for ProgramOptions {
|
impl TryFrom<&ArgMatches> for ProgramOptions {
|
||||||
type Error = ProgramOptionsError;
|
type Error = ProgramOptionsError;
|
||||||
|
|
||||||
fn try_from(matches: &ArgMatches) -> Result<Self, Self::Error> {
|
fn try_from(matches: &ArgMatches) -> Result<Self, Self::Error> {
|
||||||
|
@ -232,6 +232,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.hide(true)
|
.hide(true)
|
||||||
.required(true),
|
.required(true)
|
||||||
|
.value_hint(clap::ValueHint::CommandName),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -150,7 +150,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::FILE)
|
Arg::new(options::FILE)
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
.hide(true),
|
.hide(true)
|
||||||
|
.value_hint(clap::ValueHint::FilePath),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::BSD_COMPATIBLE)
|
Arg::new(options::BSD_COMPATIBLE)
|
||||||
|
|
|
@ -16,7 +16,7 @@ path = "src/sync.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "3.1", features = ["wrap_help", "cargo"] }
|
clap = { version = "3.1", features = ["wrap_help", "cargo"] }
|
||||||
libc = "0.2.125"
|
libc = "0.2.126"
|
||||||
uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["wide"] }
|
uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["wide"] }
|
||||||
winapi = { version = "0.3", features = ["errhandlingapi", "fileapi", "handleapi", "std", "winbase", "winerror"] }
|
winapi = { version = "0.3", features = ["errhandlingapi", "fileapi", "handleapi", "std", "winbase", "winerror"] }
|
||||||
|
|
||||||
|
|
|
@ -217,7 +217,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(ARG_FILES)
|
Arg::new(ARG_FILES)
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
.takes_value(true),
|
.takes_value(true)
|
||||||
|
.value_hint(clap::ValueHint::AnyPath),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::FILE)
|
Arg::new(options::FILE)
|
||||||
.hide(true)
|
.hide(true)
|
||||||
.multiple_occurrences(true),
|
.multiple_occurrences(true)
|
||||||
|
.value_hint(clap::ValueHint::FilePath),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ path = "src/tail.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "3.1", features = ["wrap_help", "cargo"] }
|
clap = { version = "3.1", features = ["wrap_help", "cargo"] }
|
||||||
libc = "0.2.125"
|
libc = "0.2.126"
|
||||||
uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["ringbuffer", "lines"] }
|
uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["ringbuffer", "lines"] }
|
||||||
|
|
||||||
[target.'cfg(windows)'.dependencies]
|
[target.'cfg(windows)'.dependencies]
|
||||||
|
|
|
@ -19,7 +19,7 @@ pub fn parse_obsolete(src: &str) -> Option<Result<impl Iterator<Item = OsString>
|
||||||
let mut has_num = false;
|
let mut has_num = false;
|
||||||
let mut last_char = 0 as char;
|
let mut last_char = 0 as char;
|
||||||
for (n, c) in &mut chars {
|
for (n, c) in &mut chars {
|
||||||
if c.is_digit(10) {
|
if c.is_ascii_digit() {
|
||||||
has_num = true;
|
has_num = true;
|
||||||
num_end = n;
|
num_end = n;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -351,7 +351,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
Arg::new(options::ARG_FILES)
|
Arg::new(options::ARG_FILES)
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.min_values(1),
|
.min_values(1)
|
||||||
|
.value_hint(clap::ValueHint::FilePath),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ path = "src/tee.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "3.1", features = ["wrap_help", "cargo"] }
|
clap = { version = "3.1", features = ["wrap_help", "cargo"] }
|
||||||
libc = "0.2.125"
|
libc = "0.2.126"
|
||||||
retain_mut = "=0.1.7" # ToDO: [2021-01-01; rivy; maint/MinSRV] ~ v0.1.5 uses const generics which aren't stabilized until rust v1.51.0
|
retain_mut = "=0.1.7" # ToDO: [2021-01-01; rivy; maint/MinSRV] ~ v0.1.5 uses const generics which aren't stabilized until rust v1.51.0
|
||||||
uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["libc"] }
|
uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["libc"] }
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,11 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.short('i')
|
.short('i')
|
||||||
.help("ignore interrupt signals (ignored on non-Unix platforms)"),
|
.help("ignore interrupt signals (ignored on non-Unix platforms)"),
|
||||||
)
|
)
|
||||||
.arg(Arg::new(options::FILE).multiple_occurrences(true))
|
.arg(
|
||||||
|
Arg::new(options::FILE)
|
||||||
|
.multiple_occurrences(true)
|
||||||
|
.value_hint(clap::ValueHint::FilePath),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
|
|
|
@ -16,7 +16,7 @@ path = "src/test.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "3.1", features = ["wrap_help", "cargo"] }
|
clap = { version = "3.1", features = ["wrap_help", "cargo"] }
|
||||||
libc = "0.2.125"
|
libc = "0.2.126"
|
||||||
uucore = { version=">=0.0.11", package="uucore", path="../../uucore" }
|
uucore = { version=">=0.0.11", package="uucore", path="../../uucore" }
|
||||||
|
|
||||||
[target.'cfg(target_os = "redox")'.dependencies]
|
[target.'cfg(target_os = "redox")'.dependencies]
|
||||||
|
|
|
@ -16,7 +16,7 @@ path = "src/timeout.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "3.1", features = ["wrap_help", "cargo"] }
|
clap = { version = "3.1", features = ["wrap_help", "cargo"] }
|
||||||
libc = "0.2.125"
|
libc = "0.2.126"
|
||||||
nix = { version = "0.24.1", default-features = false, features = ["signal"] }
|
nix = { version = "0.24.1", default-features = false, features = ["signal"] }
|
||||||
uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["process", "signals"] }
|
uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["process", "signals"] }
|
||||||
|
|
||||||
|
|
|
@ -170,6 +170,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.index(2)
|
.index(2)
|
||||||
.required(true)
|
.required(true)
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
|
.value_hint(clap::ValueHint::CommandName)
|
||||||
)
|
)
|
||||||
.trailing_var_arg(true)
|
.trailing_var_arg(true)
|
||||||
.infer_long_args(true)
|
.infer_long_args(true)
|
||||||
|
|
|
@ -219,7 +219,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.long(options::sources::REFERENCE)
|
.long(options::sources::REFERENCE)
|
||||||
.help("use this file's times instead of the current time")
|
.help("use this file's times instead of the current time")
|
||||||
.value_name("FILE")
|
.value_name("FILE")
|
||||||
.allow_invalid_utf8(true),
|
.allow_invalid_utf8(true)
|
||||||
|
.value_hint(clap::ValueHint::AnyPath),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::TIME)
|
Arg::new(options::TIME)
|
||||||
|
@ -238,7 +239,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.min_values(1)
|
.min_values(1)
|
||||||
.allow_invalid_utf8(true),
|
.allow_invalid_utf8(true)
|
||||||
|
.value_hint(clap::ValueHint::AnyPath),
|
||||||
)
|
)
|
||||||
.group(ArgGroup::new(options::SOURCES).args(&[
|
.group(ArgGroup::new(options::SOURCES).args(&[
|
||||||
options::sources::CURRENT,
|
options::sources::CURRENT,
|
||||||
|
|
|
@ -143,7 +143,6 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.about(ABOUT)
|
.about(ABOUT)
|
||||||
.override_usage(format_usage(USAGE))
|
.override_usage(format_usage(USAGE))
|
||||||
.infer_long_args(true)
|
.infer_long_args(true)
|
||||||
.infer_long_args(true)
|
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::COMPLEMENT)
|
Arg::new(options::COMPLEMENT)
|
||||||
.visible_short_alias('C')
|
.visible_short_alias('C')
|
||||||
|
|
|
@ -162,6 +162,7 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.required_unless_present(options::SIZE)
|
.required_unless_present(options::SIZE)
|
||||||
.help("base the size of each file on the size of RFILE")
|
.help("base the size of each file on the size of RFILE")
|
||||||
.value_name("RFILE")
|
.value_name("RFILE")
|
||||||
|
.value_hint(clap::ValueHint::FilePath)
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::SIZE)
|
Arg::new(options::SIZE)
|
||||||
|
@ -176,7 +177,8 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.multiple_occurrences(true)
|
.multiple_occurrences(true)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.required(true)
|
.required(true)
|
||||||
.min_values(1))
|
.min_values(1)
|
||||||
|
.value_hint(clap::ValueHint::FilePath))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Truncate the named file to the specified size.
|
/// Truncate the named file to the specified size.
|
||||||
|
|
|
@ -50,11 +50,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||||
let mut line = String::new();
|
let mut line = String::new();
|
||||||
match reader.read_line(&mut line) {
|
match reader.read_line(&mut line) {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
let tokens: Vec<String> = line
|
let tokens: Vec<String> = line.split_whitespace().map(|s| s.to_owned()).collect();
|
||||||
.trim_end()
|
|
||||||
.split_whitespace()
|
|
||||||
.map(|s| s.to_owned())
|
|
||||||
.collect();
|
|
||||||
if tokens.is_empty() {
|
if tokens.is_empty() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -99,7 +95,12 @@ pub fn uu_app<'a>() -> Command<'a> {
|
||||||
.override_usage(format_usage(USAGE))
|
.override_usage(format_usage(USAGE))
|
||||||
.about(SUMMARY)
|
.about(SUMMARY)
|
||||||
.infer_long_args(true)
|
.infer_long_args(true)
|
||||||
.arg(Arg::new(options::FILE).default_value("-").hide(true))
|
.arg(
|
||||||
|
Arg::new(options::FILE)
|
||||||
|
.default_value("-")
|
||||||
|
.hide(true)
|
||||||
|
.value_hint(clap::ValueHint::FilePath),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// We use String as a representation of node here
|
// We use String as a representation of node here
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue