Compare commits
No commits in common. "0f9e414014a6e9eaa7fe723a251d402fe9e26d6d" and "e59580b892a92b21a081b3879f981627567ce6b4" have entirely different histories.
0f9e414014
...
e59580b892
25 changed files with 41 additions and 61 deletions
|
@ -1,4 +1,4 @@
|
||||||
# SPDX-FileCopyrightText: 2021-2022 Lynnesbian
|
# SPDX-FileCopyrightText: 2021 Lynnesbian
|
||||||
# SPDX-License-Identifier: CC0-1.0
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
3
.gitattributes
vendored
3
.gitattributes
vendored
|
@ -1,4 +1 @@
|
||||||
# SPDX-FileCopyrightText: 2021-2022 Lynnesbian
|
|
||||||
# SPDX-License-Identifier: CC0-1.0
|
|
||||||
|
|
||||||
doc/screenshot.png filter=lfs diff=lfs merge=lfs -text
|
doc/screenshot.png filter=lfs diff=lfs merge=lfs -text
|
||||||
|
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,4 +1,4 @@
|
||||||
# SPDX-FileCopyrightText: 2021-2022 Lynnesbian
|
# SPDX-FileCopyrightText: 2021 Lynnesbian
|
||||||
# SPDX-License-Identifier: CC0-1.0
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
|
||||||
/target
|
/target
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# SPDX-FileCopyrightText: 2021-2022 Lynnesbian
|
# SPDX-FileCopyrightText: 2021 Lynnesbian
|
||||||
# SPDX-License-Identifier: CC0-1.0
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
|
||||||
image: "rust:latest"
|
image: "rust:latest"
|
||||||
|
|
|
@ -3,7 +3,7 @@ Upstream-Name: fif
|
||||||
Upstream-Contact: Lynnesbian <lynne@bune.city>
|
Upstream-Contact: Lynnesbian <lynne@bune.city>
|
||||||
Source: https://gitlab.com/Lynnesbian/fif/
|
Source: https://gitlab.com/Lynnesbian/fif/
|
||||||
|
|
||||||
Files: .idea/**/* .idea/* Cargo.lock .mailmap .kateproject *.toml
|
Files: .idea/**/* .idea/* Cargo.lock .mailmap .kateproject
|
||||||
Copyright: Lynnesbian
|
Copyright: Lynnesbian
|
||||||
License: CC0-1.0
|
License: CC0-1.0
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
## Unreleased
|
## Unreleased
|
||||||
### Added
|
### Added
|
||||||
- When using the [`infer`] backend, fif is now able to detect [Mach-O](https://en.wikipedia.org/wiki/Mach-O) binaries
|
- When using the [`infer`] backend, fif is now able to detect [Mach-O](https://en.wikipedia.org/wiki/Mach-O) binaries
|
||||||
### Other
|
|
||||||
- (@hannesbraun) Updated [`infer`] to v0.6.0 (!2)
|
|
||||||
|
|
||||||
## v0.5.0 - 2022-01-01
|
## v0.5.0 - 2022-01-01
|
||||||
### Changed
|
### Changed
|
||||||
|
@ -81,7 +79,6 @@ this version of `clap`, which caused the build to fail. Also, `clap` 3 beta 4 de
|
||||||
- `-I`/`--ignore-unknown-exts` flag for ignoring files with unknown extensions - for example, if fif doesn't know
|
- `-I`/`--ignore-unknown-exts` flag for ignoring files with unknown extensions - for example, if fif doesn't know
|
||||||
what a ".fake" file is, setting this flag will prevent it from renaming "photo.fake" to "photo.jpg". This is useful
|
what a ".fake" file is, setting this flag will prevent it from renaming "photo.fake" to "photo.jpg". This is useful
|
||||||
for avoiding the case where fif incorrectly mislabels an obscure format it isn't aware of as something else.
|
for avoiding the case where fif incorrectly mislabels an obscure format it isn't aware of as something else.
|
||||||
- (@herbygillot) Added [MacPorts](https://www.macports.org/) install instructions (!1)
|
|
||||||
### Other
|
### Other
|
||||||
- Refactored `formats.rs`
|
- Refactored `formats.rs`
|
||||||
- More accurate dependency versions in `Cargo.toml` to ensure that the MSRV stays supported
|
- More accurate dependency versions in `Cargo.toml` to ensure that the MSRV stays supported
|
||||||
|
|
20
Cargo.lock
generated
20
Cargo.lock
generated
|
@ -211,9 +211,9 @@ checksum = "de853764b47027c2e862a995c34978ffa63c1501f2e15f987ba11bd4f9bba193"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fastrand"
|
name = "fastrand"
|
||||||
version = "1.7.0"
|
version = "1.6.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf"
|
checksum = "779d043b6a0b90cc4c0ed7ee380a6504394cee7efd7db050e3774eee387324b2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"instant",
|
"instant",
|
||||||
]
|
]
|
||||||
|
@ -579,9 +579,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "quote"
|
name = "quote"
|
||||||
version = "1.0.15"
|
version = "1.0.14"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145"
|
checksum = "47aa80447ce4daf1717500037052af176af5d38cc3e571d9ec1c7353fc10c87d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
]
|
]
|
||||||
|
@ -723,18 +723,18 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.134"
|
version = "1.0.133"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "96b3c34c1690edf8174f5b289a336ab03f568a4460d8c6df75f2f3a692b3bc6a"
|
checksum = "97565067517b60e2d1ea8b268e59ce036de907ac523ad83a0475da04e818989a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.134"
|
version = "1.0.133"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "784ed1fbfa13fe191077537b0d70ec8ad1e903cfe04831da608aa36457cb653d"
|
checksum = "ed201699328568d8d08208fdd080e3ff594e6c422e438b6705905da01005d537"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
@ -743,9 +743,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_json"
|
name = "serde_json"
|
||||||
version = "1.0.76"
|
version = "1.0.75"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "edde269018d33d7146dd074e5f7da6fef9b0a957507454c867caa0852c560a9a"
|
checksum = "c059c05b48c5c0067d4b4b2b4f0732dd65feb52daf7e0ea09cd87e7dadc1af79"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"itoa",
|
"itoa",
|
||||||
"ryu",
|
"ryu",
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
# SPDX-FileCopyrightText: 2021 Lynnesbian
|
||||||
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
|
||||||
[package]
|
[package]
|
||||||
name = "fif"
|
name = "fif"
|
||||||
description = "A command-line tool for detecting and optionally correcting files with incorrect extensions."
|
description = "A command-line tool for detecting and optionally correcting files with incorrect extensions."
|
||||||
|
|
|
@ -1,2 +1,5 @@
|
||||||
|
# SPDX-FileCopyrightText: 2021 Lynnesbian
|
||||||
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
|
||||||
[build.env]
|
[build.env]
|
||||||
passthrough = ["RUST_BACKTRACE", "RUST_LOG", "FIF_LOG"]
|
passthrough = ["RUST_BACKTRACE", "RUST_LOG", "FIF_LOG"]
|
||||||
|
|
19
README.md
19
README.md
|
@ -140,25 +140,6 @@ You can also manually specify an output format to use:
|
||||||
fif -O powershell ~/Documents > output.ps1
|
fif -O powershell ~/Documents > output.ps1
|
||||||
```
|
```
|
||||||
|
|
||||||
#### The `--fix` flag
|
|
||||||
|
|
||||||
If, however, you'd rather have fif fix the misnamed files itself, rather than relying on a shell script, you can use
|
|
||||||
the `--fix` flag:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# rename any misnamed .jpg files in the user's pictures directory
|
|
||||||
fif ~/Pictures --fix -e jpg
|
|
||||||
# fix any misnamed files found in the user's downloads
|
|
||||||
fif ~/Downloads --fix
|
|
||||||
```
|
|
||||||
|
|
||||||
By default, fif will avoid taking any potentially destructive actions (renaming a file to a name that already exists).
|
|
||||||
This behaviour can be disabled with the `--overwrite` flag, which will instead prompt you to overwrite the existing
|
|
||||||
file. fif will also prompt you to retry on errors.
|
|
||||||
|
|
||||||
For more information on how the `--fix` flag works, and how it behaves in conjunction with the `--overwrite` flag
|
|
||||||
and `--prompt` parameter, see [the corresponding wiki page](https://gitlab.com/Lynnesbian/fif/-/wikis/Fix).
|
|
||||||
|
|
||||||
### Logging
|
### Logging
|
||||||
By default, fif will log any info, warnings, and errors encountered during execution. This can be changed with the `-v`
|
By default, fif will log any info, warnings, and errors encountered during execution. This can be changed with the `-v`
|
||||||
flag:
|
flag:
|
||||||
|
|
2
build.rs
2
build.rs
|
@ -1,4 +1,4 @@
|
||||||
// SPDX-FileCopyrightText: 2021-2022 Lynnesbian
|
// SPDX-FileCopyrightText: 2021 Lynnesbian
|
||||||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||||
|
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# SPDX-FileCopyrightText: 2021-2022 Lynnesbian
|
# SPDX-FileCopyrightText: 2021 Lynnesbian
|
||||||
# SPDX-License-Identifier: CC0-1.0
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
# SPDX-FileCopyrightText: 2021 Lynnesbian
|
||||||
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
|
||||||
# avoid-breaking-exported-api = false # only available on nightly for now
|
# avoid-breaking-exported-api = false # only available on nightly for now
|
||||||
cognitive-complexity-threshold = 15
|
cognitive-complexity-threshold = 15
|
||||||
msrv = "1.54.0"
|
msrv = "1.54.0"
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
Where's the documentation?
|
|
||||||
===
|
|
||||||
If you're looking for documentation on fif, try checking...
|
|
||||||
- The built-in help documentation, by running `fif --help`
|
|
||||||
- [The usage section in the README file](https://gitlab.com/Lynnesbian/fif/-/blob/master/README.md#usage), for a
|
|
||||||
brief overview of fif's functionality and how to use it
|
|
||||||
- [The wiki](https://gitlab.com/Lynnesbian/fif/-/wikis/home), for more detailed information on fif's behaviour
|
|
||||||
- [Docs.rs](https://docs.rs/fif/latest/fif/), for information pertaining to fif's internals
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
# SPDX-FileCopyrightText: 2021 Lynnesbian
|
||||||
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
|
||||||
max_width = 120
|
max_width = 120
|
||||||
fn_single_line = true
|
fn_single_line = true
|
||||||
hard_tabs = true
|
hard_tabs = true
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// SPDX-FileCopyrightText: 2021-2022 Lynnesbian
|
// SPDX-FileCopyrightText: 2021 Lynnesbian
|
||||||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||||
|
|
||||||
//! File handling - scanning, detecting MIME types, and so on.
|
//! File handling - scanning, detecting MIME types, and so on.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// SPDX-FileCopyrightText: 2021-2022 Lynnesbian
|
// SPDX-FileCopyrightText: 2021 Lynnesbian
|
||||||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||||
|
|
||||||
//! The [`Findings`] and [`ScanError`] structs, used for conveying whether a given file was able to be scanned, whether
|
//! The [`Findings`] and [`ScanError`] structs, used for conveying whether a given file was able to be scanned, whether
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// SPDX-FileCopyrightText: 2021-2022 Lynnesbian
|
// SPDX-FileCopyrightText: 2021 Lynnesbian
|
||||||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||||
|
|
||||||
//! Logic for handling the various output formats that fif can output to.
|
//! Logic for handling the various output formats that fif can output to.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// SPDX-FileCopyrightText: 2021-2022 Lynnesbian
|
// SPDX-FileCopyrightText: 2021 Lynnesbian
|
||||||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||||
|
|
||||||
//! This library consists of all of the things fif needs to run. It only exists as a library to separate code, and to
|
//! This library consists of all of the things fif needs to run. It only exists as a library to separate code, and to
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// SPDX-FileCopyrightText: 2021-2022 Lynnesbian
|
// SPDX-FileCopyrightText: 2021 Lynnesbian
|
||||||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||||
|
|
||||||
// fif - a command-line tool for detecting and optionally correcting files with incorrect extensions.
|
// fif - a command-line tool for detecting and optionally correcting files with incorrect extensions.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// SPDX-FileCopyrightText: 2021-2022 Lynnesbian
|
// SPDX-FileCopyrightText: 2021 Lynnesbian
|
||||||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||||
|
|
||||||
//! Backend-neutral Mime database abstraction.
|
//! Backend-neutral Mime database abstraction.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// SPDX-FileCopyrightText: 2021-2022 Lynnesbian
|
// SPDX-FileCopyrightText: 2021 Lynnesbian
|
||||||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||||
|
|
||||||
//! Command line argument parsing logic and associated functions.
|
//! Command line argument parsing logic and associated functions.
|
||||||
|
@ -58,8 +58,8 @@ pub enum Prompt {
|
||||||
long_version = CLAP_LONG_VERSION.as_str(),
|
long_version = CLAP_LONG_VERSION.as_str(),
|
||||||
author = option_env!("CARGO_PKG_AUTHORS").unwrap_or("Lynnesbian"),
|
author = option_env!("CARGO_PKG_AUTHORS").unwrap_or("Lynnesbian"),
|
||||||
about = option_env!("CARGO_PKG_DESCRIPTION").unwrap_or("File Info Fixer"),
|
about = option_env!("CARGO_PKG_DESCRIPTION").unwrap_or("File Info Fixer"),
|
||||||
before_help = "Copyright © 2021-2022 Lynnesbian under the GPL3 (or later) License.",
|
before_help = "Copyright © 2021 Lynnesbian under the GPL3 (or later) License.",
|
||||||
after_long_help = "Copyright © 2021-2022 Lynnesbian\n\
|
after_long_help = "Copyright © 2021 Lynnesbian\n\
|
||||||
This program is free software: you can redistribute it and/or modify \
|
This program is free software: you can redistribute it and/or modify \
|
||||||
it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 \
|
it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 \
|
||||||
of the License, or (at your option) any later version.",
|
of the License, or (at your option) any later version.",
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
// SPDX-FileCopyrightText: 2021-2022 Lynnesbian
|
// SPDX-FileCopyrightText: 2021 2021 Lynnesbian
|
||||||
|
// SPDX-FileCopyrightText: 2021 Lynnesbian
|
||||||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||||
|
|
||||||
use std::collections::{BTreeMap, HashMap};
|
use std::collections::{BTreeMap, HashMap};
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// SPDX-FileCopyrightText: 2021-2022 Lynnesbian
|
// SPDX-FileCopyrightText: 2021 Lynnesbian
|
||||||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||||
|
|
||||||
//! Various minor utilities.
|
//! Various minor utilities.
|
||||||
|
|
2
test.py
2
test.py
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
# SPDX-FileCopyrightText: 2021-2022 Lynnesbian
|
# SPDX-FileCopyrightText: 2021 Lynnesbian
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: LGPL-3.0-or-later
|
# SPDX-License-Identifier: LGPL-3.0-or-later
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue