Skip to content

Commit

Permalink
almost ready
Browse files Browse the repository at this point in the history
  • Loading branch information
jqk committed Sep 9, 2023
1 parent 0a75bf8 commit 7889784
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
- goos: macos
artifactext: ""
os: macos-latest
artifactname: "vssc"
artifactname: "fdg"
goarch: arm64

steps:
Expand Down
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

## What is it

FileDiffGrouper is a command line tool for comparing file differences between two directories. It compares all files in the two directories byte-by-byte based on content, rather than filenames. Although only tested on Windows 10/11, it does not use any OS-specific features, so theoretically can run on Linux and MacOS as well.
`FileDiffGrouper` is a command line tool for comparing file differences between two directories. It compares all files in the two directories byte-by-byte based on content, rather than filenames. Although only tested on Windows 10/11, it does not use any OS-specific features, so theoretically can run on Linux and MacOS as well.

FileDiffGrouper compares two directories - one called the Base directory, the other called the Target directory. FileDiffGrouper will output two result sets, saved to result files:
`FileDiffGrouper` compares two directories - one called the Base directory, the other called the Target directory. `FileDiffGrouper` will output two result sets, saved to result files:

- MORE set: Files that exist in Target but not in Base, referred to as "extra files" in this document.
- SAME set: Files that exist in both Target and Base and have identical content, referred to as "duplicate files" in this document.

FileDiffGrouper can optionally move the files in the MORE and SAME sets to specified backup directories, based on options. For safety, it does not provide functionality to automatically delete these files.
`FileDiffGrouper` can optionally move the files in the MORE and SAME sets to specified backup directories, based on options. For safety, it does not provide functionality to automatically delete these files.

## What to solve

Expand All @@ -30,7 +30,7 @@ With the development of electronics technology, we generate a lot of files in wo

Backing up data is a relatively professional job. For most people, it is difficult to manage backups precisely. Backups are often made irregularly over different periods, with no rules for timing, quantity, or destinations. As a result, there are many backup copies, with no clear relationships between different backups, leading to a large number of duplicate and orphaned backups. Using the above tools to find and categorize duplicate files among hundreds of thousands of files is very time consuming and laborious.

FileDiffGrouper is a tool to quickly find identical and different files between two directories.
`FileDiffGrouper` is a tool to quickly find identical and different files between two directories.

> FileDiffGrouper only finds duplicate and extra files in Target relative to Base. It does not deduplicate Base itself. Please use the tools listed above to deduplicate Base first. Of course, it is recommended to also deduplicate Target before using this tool, to improve efficiency.
Expand All @@ -49,11 +49,19 @@ FileDiffGrouper is a tool to quickly find identical and different files between

On Windows, the executable filename is `fdg.exe`, around 6MB in size.

In addition to the executable file, a sample config file is also provided: config.yaml.

## Usage

### Command line

Executing the `fdg` command is simple - just provide the full path to the configuration file, e.g. `fdg c:\test\config.yaml`. There are no specific requirements for the configuration filename itself, but it must have the correct file extension, see `Configuration` section for details.
Executing the `fdg` command is simple - just provide the full path to the configuration file.

```text {.line-numbers}
fdg c:\test\config.yaml
```

There are no specific requirements for the configuration filename itself, but it must have the correct file extension, see `Configuration` section for details.

```text {.line-numbers}
$ fdg
Expand All @@ -70,7 +78,7 @@ Usage:

### Configuration

Since there are many parameters to specify, command line arguments are not used. Instead, a configuration file is used. The configuration file can be in formats supported by [viper](http://github.com/spf13/viper%7Cgithub.com/spf13/viper) such as `.json`, `.xml,` `.yml` and `.toml`. The example below uses `yaml`. Please refer to the comments.
Since there are many parameters to specify, command line arguments are not used. Instead, a configuration file is used. The configuration file can be in formats supported by [viper](http://github.com/spf13/viper%7Cgithub.com/spf13/viper) such as `.json`, `.xml,` `.yml` and `.toml`. The example below uses `.yaml`. Please refer to the comments.

You don't need to read through in detail at first. Each parameter in the configuration file will be explained in more detail in the `How It Works and Parameter Descriptions` section.

Expand Down
12 changes: 10 additions & 2 deletions readme-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,19 @@ FileDiffGrouper 就是这样一款快速找出两个目录之间相同与不同

在 Windows 下,可执行文件名为 `fdg.exe`,约 6MB。

除可执行文件外,还提供了示例的配置文件:config.yaml。

## 四、 使用

### 4.1 命令行

执行 `fdg` 命令很简单,仅需提供配置文件的完整路径,如 `fdg c:\test\config.yaml`。对配置文件名本身没有特别要求,但必须有正确格式的扩展名,见`配置文件`说明。
执行 `fdg` 命令很简单,仅需提供配置文件的完整路径,如:

```text {.line-numbers}
fdg c:\test\config.yaml
```

对配置文件名本身没有特别要求,但必须有正确格式的扩展名,见`配置文件`说明。

```text {.line-numbers}
$ fdg
Expand All @@ -70,7 +78,7 @@ Usage:

### 4.2 配置文件

由于要指定的参数很多,就不使用命令行参数的形式,而使用配置文件。配置文件可以是 `.json``.xml``.yml``.toml`[viper](github.com/spf13/viper) 支持的格式。以下以 `yaml` 为例说明,请参见注释。
由于要指定的参数很多,就不使用命令行参数的形式,而使用配置文件。配置文件可以是 `.json``.xml``.yml``.toml`[viper](github.com/spf13/viper) 支持的格式。以下以 `.yaml` 为例说明,请参见注释。

一开始不必细读,配置文件里各个参数会在`工作原理及参数说明`中更详细的说明。

Expand Down

0 comments on commit 7889784

Please sign in to comment.