~iptq/garbage

8d6e5eadc7bbbf7b99ae62c79e2c8e68c25cfc03 — Michael Zhang 2 years ago 2c2acd1
rename
7 files changed, 28 insertions(+), 28 deletions(-)

M Cargo.lock
M Cargo.toml
M README.md
R src/{trashdir.rs => dir.rs}
R src/{trashinfo.rs => info.rs}
M src/main.rs
M src/ops.rs
M Cargo.lock => Cargo.lock +14 -14
@@ 77,6 77,20 @@ dependencies = [
]

[[package]]
name = "garbage"
version = "0.1.1"
dependencies = [
 "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
 "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
 "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
 "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
 "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
 "structopt 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
 "walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)",
 "xdg 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "heck"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"


@@ 263,20 277,6 @@ dependencies = [
]

[[package]]
name = "trash-cli"
version = "0.1.1"
dependencies = [
 "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
 "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
 "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
 "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
 "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
 "structopt 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
 "walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)",
 "xdg 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "unicode-segmentation"
version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"

M Cargo.toml => Cargo.toml +2 -2
@@ 1,11 1,11 @@
[package]
name = "trash-cli"
name = "garbage"
version = "0.1.1"
authors = ["Michael Zhang <iptq@protonmail.com>"]
edition = "2018"

[[bin]]
name = "trash"
name = "garbage"
path = "src/main.rs"

[dependencies]

M README.md => README.md +6 -6
@@ 1,5 1,5 @@
trash-cli
=========
garbage
=======

rust ver of trash-cli, basic functionality is in, code is probably shit



@@ 9,14 9,14 @@ Usage
-----

```
$ trash put [-r] file1 file2 ...
$ garbage put [-r] file1 file2 ...

$ trash restore
$ garbage restore
[..interactive]

$ trash list
$ garbage list

$ trash empty [days]
$ garbage empty [days]
```

About

R src/trashdir.rs => src/dir.rs +1 -1
@@ 4,7 4,7 @@ use std::path::PathBuf;
use walkdir::{DirEntry, WalkDir};

use crate::errors::Error;
use crate::trashinfo::TrashInfo;
use crate::info::TrashInfo;
use crate::XDG;

#[derive(Debug)]

R src/trashinfo.rs => src/info.rs +0 -0
M src/main.rs => src/main.rs +3 -3
@@ 5,8 5,8 @@ extern crate log;

mod errors;
mod ops;
mod trashdir;
mod trashinfo;
mod dir;
mod info;

use std::fs;
use std::io;


@@ 16,7 16,7 @@ use structopt::StructOpt;
use xdg::BaseDirectories;

use crate::errors::Error;
use crate::trashdir::TrashDir;
use crate::dir::TrashDir;

lazy_static! {
    static ref XDG: BaseDirectories = BaseDirectories::new().unwrap();

M src/ops.rs => src/ops.rs +2 -2
@@ 4,8 4,8 @@ use std::path::Path;
use chrono::{Duration, Local};

use crate::errors::Error;
use crate::trashdir::TrashDir;
use crate::trashinfo::TrashInfo;
use crate::dir::TrashDir;
use crate::info::TrashInfo;

pub fn empty(dry: bool, days: Option<u32>) -> Result<(), Error> {
    let home_trash = TrashDir::get_home_trash();