Skip to content

Commit

Permalink
Merge branch 'main' into help-color
Browse files Browse the repository at this point in the history
  • Loading branch information
simonsan authored Jan 28, 2024
2 parents 5a556dd + 7019743 commit 2ae6587
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8 # v1
with:
toolchain: stable
- uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2
- uses: rustsec/audit-check@dd51754d4e59da7395a4cd9b593f0ff2d61a9b95 # v1.4.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -38,7 +38,7 @@ jobs:
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- uses: EmbarkStudios/cargo-deny-action@1e59595bed8fc55c969333d08d7817b36888f0c5 # v1
- uses: EmbarkStudios/cargo-deny-action@2fad0807be2b6f4402fd9dd4225aa4e91b9ad879 # v1
with:
command: check bans licenses sources

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
with:
toolchain: stable
components: clippy
- uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2
- name: Run clippy
run: cargo clippy --all-targets --features ${{ matrix.feature }} -- -D warnings

Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8 # v1
with:
toolchain: stable
- uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2
- name: Run Cargo Test
run: cargo test -r --all-targets --features ${{ matrix.feature }} --workspace

Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:
uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8 # v1
with:
toolchain: stable
- uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2
- name: Run Cargo Doc
run: cargo doc --no-deps --all-features --workspace --examples

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download all workflow run artifacts
uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4
uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4
- name: Releasing nightly builds
shell: bash
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8 # v1
with:
toolchain: stable
- uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2
- name: Run Cargo Test
run: cargo test --release -p rustic-rs --test completions -- --ignored
#
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ jobs:
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: chainguard-dev/actions/setup-gitsign@main
- uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2
- name: Install cargo-release
uses: taiki-e/install-action@56ab7930c591507f833cbaed864d201386d518a8 # v2
uses: taiki-e/install-action@8984d603c208823d3c1a1b796f4081736f3ae3f9 # v2
with:
tool: cargo-release
- uses: cargo-bins/release-pr@deeacca5a38bacc74a3f444b798f4b9bba40f6ad # v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
sudo apt update
sudo apt-get install -y musl-tools
fi
- uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2
with:
key: ${{ matrix.job.target }}
- name: Set Version
Expand Down Expand Up @@ -109,7 +109,7 @@ jobs:
shasum -a 256 $RELEASE_NAME.tar.gz > $RELEASE_NAME.sha256
fi
- name: Storing binary as artefact
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4
uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4
with:
name: binary-${{ matrix.job.target}}
path: target/${{ matrix.job.target }}/release/rustic-${{ github.ref_name }}-${{ matrix.job.target}}.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-completions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
with:
toolchain: stable

- uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # v2
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2

- name: Run Cargo Install
id: generated-fixtures
Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ tempfile = { workspace = true }
toml = { workspace = true }

[target.'cfg(not(windows))'.dependencies]
libc = "0.2.151"
libc = "0.2.152"
[workspace.dependencies]
rustic_core = { version = "0.1.2", features = ["cli"] }
abscissa_core = { version = "0.7.0", default-features = false, features = ["application"] }
Expand Down
22 changes: 18 additions & 4 deletions src/commands/ls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ pub(crate) struct LsCmd {
#[clap(long, short = 'l')]
long: bool,

/// show uid/gid instead of user/group
#[clap(long)]
numeric_uid_gid: bool,

/// Listing options
#[clap(flatten)]
ls_opts: LsOptions,
Expand Down Expand Up @@ -103,7 +107,7 @@ impl LsCmd {
let (path, node) = item?;
summary.update(&node);
if self.long {
print_node(&node, &path);
print_node(&node, &path, self.numeric_uid_gid);
} else {
println!("{path:?} ");
}
Expand All @@ -126,7 +130,7 @@ impl LsCmd {
///
/// * `node` - the node to print
/// * `path` - the path of the node
fn print_node(node: &Node, path: &Path) {
fn print_node(node: &Node, path: &Path, numeric_uid_gid: bool) {
println!(
"{:>1}{:>9} {:>8} {:>8} {:>9} {:>12} {path:?} {}",
match node.node_type {
Expand All @@ -142,8 +146,18 @@ fn print_node(node: &Node, path: &Path) {
.mode
.map(parse_permissions)
.unwrap_or_else(|| "?????????".to_string()),
node.meta.user.clone().unwrap_or_else(|| "?".to_string()),
node.meta.group.clone().unwrap_or_else(|| "?".to_string()),
if numeric_uid_gid {
node.meta.uid.map(|uid| uid.to_string())
} else {
node.meta.user.clone()
}
.unwrap_or_else(|| "?".to_string()),
if numeric_uid_gid {
node.meta.gid.map(|uid| uid.to_string())
} else {
node.meta.group.clone()
}
.unwrap_or_else(|| "?".to_string()),
node.meta.size,
node.meta
.mtime
Expand Down

0 comments on commit 2ae6587

Please sign in to comment.