Skip to content

Commit 8621895

Browse files
authored
Rename executable to trashy (oberblastmeister#104) (oberblastmeister#106)
Since trashy no longer supports `trash <PATH> ...` and has given up on being a drop-in trash-cli replacement, the executable name `trash` is only a hinderance to greater adoption because it conflicts with the trash-cli executable of the same name. Giving the executable a unique name allows both programs to be installed without issue and also allows programs that wish to shell out to external commands for trashing files to support trashy by simply checking if an executable named `trashy` is present. Before this change, these programs had to check the output of the user's `trash` command to determine if it was from trash-cli or trashy.
1 parent c95b22c commit 8621895

File tree

9 files changed

+29
-29
lines changed

9 files changed

+29
-29
lines changed

.github/workflows/release.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ jobs:
6262
shell: bash
6363
run: |
6464
if [ "${{ matrix.os }}" = "windows-latest" ]; then
65-
mv "target/${{ matrix.target }}/release/trash.exe" "trash-${{ matrix.target }}.exe"
66-
echo "ASSET=trash-${{ matrix.target }}.exe" >> $GITHUB_ENV
65+
mv "target/${{ matrix.target }}/release/trashy.exe" "trashy-${{ matrix.target }}.exe"
66+
echo "ASSET=trashy-${{ matrix.target }}.exe" >> $GITHUB_ENV
6767
else
68-
mv "target/${{ matrix.target }}/release/trash" "trash"
69-
tar czf trash-${{ matrix.target }}.tar.gz trash
70-
echo "ASSET=trash-${{ matrix.target }}.tar.gz" >> $GITHUB_ENV
68+
mv "target/${{ matrix.target }}/release/trashy" "trashy"
69+
tar czf trashy-${{ matrix.target }}.tar.gz trashy
70+
echo "ASSET=trashy-${{ matrix.target }}.tar.gz" >> $GITHUB_ENV
7171
fi
7272
7373
- name: Upload artifact

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Features
66

7-
- `trash restore` will pull up an interactive prompt if no arguments are given
7+
- `trashy restore` will pull up an interactive prompt if no arguments are given
88
- upgrade to clap v4
99

1010
## Bugfixes

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ rust-version = "1.62"
1717

1818
[[bin]]
1919
path = "src/main.rs"
20-
name = "trash"
20+
name = "trashy"
2121

2222
[dependencies]
2323
clap_mangen = "0.2.9"

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Quick links:
1515

1616
## Features
1717

18-
- easy to use, just run `trash PATH`
18+
- easy to use, just run `trashy put PATH`
1919
- recursive by default, without having the issues
2020
- beautiful output
2121
- colorized paths (similar to *fd*)
@@ -30,28 +30,28 @@ Quick links:
3030
### Trash a path
3131

3232
```bash
33-
$ trash first second third
33+
$ trashy first second third
3434
```
3535

3636
This is just sugar for
3737

3838
```bash
39-
$ trash put first second third
39+
$ trashy put first second third
4040
```
4141

4242
### List items in the trash
4343

4444
```bash
45-
$ trash list
45+
$ trashy list
4646
```
4747

4848
### Restore or empty some files
4949

5050
```bash
51-
$ trash restore first second
51+
$ trashy restore first second
5252
```
5353
```bash
54-
$ trash empty first second third
54+
$ trashy empty first second third
5555
```
5656

5757
The `restore` and `empty` subcommands both take very similar arguments and flags.
@@ -63,11 +63,11 @@ Use the `-m` option to interpret them differently.
6363
### Restore or empty all files
6464

6565
```bash
66-
$ trash restore --all
66+
$ trashy restore --all
6767
```
6868

6969
```bash
70-
$ trash empty --all
70+
$ trashy empty --all
7171
```
7272

7373
## Integrations
@@ -77,13 +77,13 @@ $ trash empty --all
7777
Restore with fzf
7878

7979
```bash
80-
trash list | fzf --multi | awk '{$1=$1;print}' | rev | cut -d ' ' -f1 | rev | xargs trash restore --match=exact --force
80+
trashy list | fzf --multi | awk '{$1=$1;print}' | rev | cut -d ' ' -f1 | rev | xargs trashy restore --match=exact --force
8181
```
8282

8383
Empty with fzf
8484

8585
```bash
86-
trash list | fzf --multi | awk '{$1=$1;print}' | rev | cut -d ' ' -f1 | rev | xargs trash empty --match=exact --force
86+
trashy list | fzf --multi | awk '{$1=$1;print}' | rev | cut -d ' ' -f1 | rev | xargs trashy empty --match=exact --force
8787
```
8888

8989
## Installation
@@ -136,7 +136,7 @@ Time (abs ≡): 65.849 s [User: 54.383 s, System: 11.370 s]
136136
Now with `trashy`
137137

138138
```
139-
hyperfine -M 1 'fd -t f --threads 1 -x trash put'
139+
hyperfine -M 1 'fd -t f --threads 1 -x trashy put'
140140
```
141141

142142
```
@@ -158,7 +158,7 @@ Range (min … max): 375.9 ms … 412.0 ms 10 runs
158158

159159

160160
```
161-
hyperfine 'trash list'
161+
hyperfine 'trashy list'
162162
```
163163

164164
```
@@ -174,9 +174,9 @@ Range (min … max): 175.6 ms … 181.0 ms 16 runs
174174

175175
No, see this [issue](https://github.com/Byron/trash-rs/issues/8)
176176

177-
### Should I alias rm='trash put'?
177+
### Should I alias rm='trashy put'?
178178

179-
You should not. The alias will not be present on other systems and habits are really hard to break. An alternative is to alias `trash put` to `rt` or `tp`.
179+
You should not. The alias will not be present on other systems and habits are really hard to break. An alternative is to alias `trashy put` to `rt` or `tp`.
180180

181181
## License
182182

src/app.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use command::Command;
99
version,
1010
about,
1111
long_about = None,
12-
after_help = "Note: `trash -h` prints a short and concise overview while `trash --help` gives all \
12+
after_help = "Note: `trashy -h` prints a short and concise overview while `trashy --help` gives all \
1313
details.",
1414
)]
1515
pub struct Args {

src/app/command/completions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub struct Args {
1313

1414
impl Args {
1515
pub fn run(&self) -> Result<()> {
16-
clap_complete::generate(self.shell, &mut app::Args::command(), "trash", &mut io::stdout());
16+
clap_complete::generate(self.shell, &mut app::Args::command(), "trashy", &mut io::stdout());
1717
Ok(())
1818
}
1919
}

src/app/command/list.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,16 @@ pub struct QueryArgs {
4646
/// This option puts the oldest trash item at the bottom.
4747
/// This will also affect 'empty' or 'restore' if used in either command.
4848
/// Examples:
49-
/// 'trash empty --rev -n=10' will delete 10 oldest trash items are deleted.
49+
/// 'trashy empty --rev -n=10' will delete 10 oldest trash items are deleted.
5050
#[arg(long, verbatim_doc_comment)]
5151
pub rev: bool,
5252

5353
/// Show 'n' maximum trash items
5454
///
5555
/// This will also affect 'empty' or 'restore' if used in either command.
5656
/// Examples:
57-
/// 'trash list -n=10' will list the ten newest trashed items.
58-
/// 'trash restore -n=10' will list restore the ten newest trashed items.
57+
/// 'trashy list -n=10' will list the ten newest trashed items.
58+
/// 'trashy restore -n=10' will list restore the ten newest trashed items.
5959
#[arg(short = 'n', long = "max", verbatim_doc_comment)]
6060
pub max: Option<NonZeroU32>,
6161
}

src/app/command/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub struct Ranges {
3737
/// Filter by ranges
3838
///
3939
/// This should be used to restore specific items.
40-
/// To find the ranges, look at the 'i' column in the table shown by 'trash list'.
40+
/// To find the ranges, look at the 'i' column in the table shown by 'trashy list'.
4141
/// The option is called '--ranges' but you can also use individual indices by just typing out the number.
4242
/// Ranges are zero based, inclusive at the start, and exclusive at the end, just like rust ranges.
4343
/// Examples:

src/filter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ pub struct FilterArgs {
6262
/// This will filter using a pattern type specified in '--match'.
6363
/// Using <PATTERNS> and '--match' gives the same effect as passing one of the pattern options explicitly.
6464
/// So for example
65-
/// trash restore '~/projects/**' '~/builds/**' --match=glob
65+
/// trashy restore '~/projects/**' '~/builds/**' --match=glob
6666
/// is the same as
67-
/// trash restore --glob='~/project/**' --glob='~/builds/**'
67+
/// trashy restore --glob='~/project/**' --glob='~/builds/**'
6868
#[arg(verbatim_doc_comment)]
6969
pub patterns: Vec<String>,
7070

0 commit comments

Comments
 (0)