Browse Source

README; install and uninstall scripts

main
Unbewohnte 3 years ago
parent
commit
3b47eec7ea
  1. 1
      .gitignore
  2. 82
      README.md
  3. 12
      install.sh
  4. 17
      src/main.cpp
  5. 4
      uninstall.sh

1
.gitignore vendored

@ -3,3 +3,4 @@ build/CMakeFiles/
build/cmake_install.cmake
build/CMakeCache.txt
build/Makefile
scan_results.txt

82
README.md

@ -0,0 +1,82 @@
# Broom
## incurable hoarder`s helpful friend
```
_
//
//
//
//
/####/
//////
///////
```
### Broom is a command line utility to locate and manage duplicate and empty files
---
## Installation
### "Compile it yourself" way
- clone this repository
`git clone https://github.com/Unbewohnte/broom`
- proceed to the directory
- compile manually or with cmake (in `build/` run:)
`cmake .`
`cmake --build .`
compiled binary for your platform will be in the newly created `bin` directory, you are free to put it
wherever you desire
if you're on GNU/Linux - you can run `install.sh` for broom to become system-wide accessible
### "The lazy" way
- proceed [to the releases page](https://github.com/Unbewohnte/broom/releases) and get yourself a pre-compiled binary
---
## Usage
broom [FLAGS..] [COMMAND] [DIRECTORY]
[FLAGS]
- `-v` or `--version` -> print version information and exit
- `-h` or `--help` -> print this message and exit
[COMMANDS]
- `sweep` -> scan for duplicate files, save results in a file and REMOVE empty files
- `scan` -> scan and save results in a file without removing anything [DEFAULT]
[DIRECTORY] is the path to the directory that will be searched for duplicate files
### Examples
- `broom scan ~/homework`
- `broom sweep ~/homework/I/have/a/lot/of/empty/files/here/for/some/reason`
after the scan the results file will be saved in your current working directory, scan results file contains
a list of duplicate files that are grouped together so you can see EXACTLY WHERE each duplicate is in the filesystem.
---
## License
GPLv3
---
## TODO
- Make it go `P` A `R` A `L` L `E` L
- Output approximate size that could be freed

12
install.sh

@ -0,0 +1,12 @@
BUILD_DIR="build"
OUTPUT_DIR="bin"
DEST_DIR="/usr/local/bin/"
BROOM_EXE_NAME="broom"
if [ -e $OUTPUT_DIR/$BROOM_EXE_NAME ]
then
mv $OUTPUT_DIR/$BROOM_EXE_NAME $DEST_DIR
else
echo "Broom not found in bin/"
fi

17
src/main.cpp

@ -28,7 +28,7 @@ along with broom. If not, see <https://www.gnu.org/licenses/>.
#include "broom.hpp"
// Broom version number
#define VERSION "v0.2.0"
#define VERSION "v0.2.1"
void print_help() {
std::cout
@ -39,7 +39,10 @@ void print_help() {
<< "[COMMANDS]" << std::endl
<< "sweep -> scan for duplicate files, save results in a file and REMOVE empty files" << std::endl
<< "scan -> scan and save results in a file without touching any files [DEFAULT]" << std::endl
<< "scan -> scan and save results in a file without removing anything [DEFAULT]" << std::endl << std::endl
<< "[DIRECTORY]" << std::endl
<< "path to the directory to be scanned" << std::endl
<< std::endl;
};
@ -108,16 +111,6 @@ int main(int argc, char* argv[]) {
broom::Broom broom;
try {
// auto t0 = std::chrono::high_resolution_clock::now();
/*
auto tracking_time = std::chrono::high_resolution_clock::now();
std::cout
<< "[BENCHMARK] Tracking took "
<< std::chrono::duration_cast<std::chrono::milliseconds>(tracking_time - t0).count()
<< " ms" << std::endl;
*/
std::cout
<< " _" << std::endl
<< " //" << std::endl

4
uninstall.sh

@ -0,0 +1,4 @@
BROOM_DIR="/usr/local/bin/"
BROOM_EXE_NAME="broom"
rm -f $BROOM_DIR/$BROOM_EXE_NAME
Loading…
Cancel
Save