Skip to content

Commit a34882f

Browse files
committed
v20 Maintenance release
This is a minor maintenance release focused on improving the tooling and build process. I apologize to any package maintainers that are affected, and hope you agree with some of the changes! Tooling changes: - Copyright info was updated - The Rakefile has been replaced with a Justfile - Ronn-ng has been replaced with scdoc With these the build dependency on Ruby is now gone! The package.rb file remains to build DEBs and RPMs with FPM. However I will no longer be providing these myself. I don't think users should be relying on these. Code changes: - Functions were all annotated with @safe or @trusted as applicable - Version name information is again in dub.json My hope is that by relying on D's safety features we can make stronger guarantees about the program, which helps long-term maintenance. The version is now 20 and the version name is now "Annette Birkin" from Resident Evil 2.
1 parent 2537f7b commit a34882f

File tree

15 files changed

+243
-290
lines changed

15 files changed

+243
-290
lines changed

.github/workflows/d.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,25 @@ on:
88

99
jobs:
1010
build:
11-
1211
runs-on: ubuntu-latest
1312

1413
steps:
1514
- uses: actions/checkout@v4
15+
- uses: extractions/setup-just@v2
1616
- uses: dlang-community/setup-dlang@v2
1717
with:
1818
compiler: ldc-latest
1919

2020
- name: Test
21-
run: rake test:coverage
21+
run: just coverage
2222

2323
- name: Build
24-
run: rake build:release:strip
24+
run: just release
2525

26-
- name: Man Page with Ronn
26+
- name: Man Page with Scdoc
2727
run: |
28-
sudo gem install ronn-ng
29-
rake manpage
28+
sudo apt install scdoc
29+
just manpage
3030
3131
- name: Distro Packages
3232
run: |
@@ -39,7 +39,7 @@ jobs:
3939
name: "trash-d"
4040
path: |
4141
build/trash
42-
build/trash.man
42+
build/trash.1
4343
4444
- name: Upload Coverage Logs
4545
uses: actions/upload-artifact@v4

.tool-versions

-1
This file was deleted.

Justfile

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
build_dir := "./build"
2+
3+
default:
4+
@just --list
5+
6+
all:
7+
just release manpage package
8+
9+
build:
10+
dub build
11+
12+
clean:
13+
dub clean
14+
rm -r {{build_dir}}
15+
16+
release:
17+
dub build --build=release
18+
strip {{build_dir}}/trash
19+
20+
test:
21+
dub test
22+
23+
coverage:
24+
mkdir -p {{build_dir}}/coverage
25+
dub test --coverage
26+
mv *.lst {build_dir}}/coverage
27+
28+
lint:
29+
dub lint
30+
31+
format:
32+
dub run dfmt -- -i source/**/*.d
33+
34+
manpage:
35+
scdoc < MANUAL.scd > {{build_dir}}/trash.1
36+

MANUAL.md

-141
This file was deleted.

MANUAL.scd

+144
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
TRASH(1)
2+
3+
# NAME
4+
5+
trash(1) - A near drop-in replacement for `rm` that uses the trash bin
6+
7+
The name of this software is "trash-d" however its executable
8+
is simply called *trash*. This manual favors the latter, but the two
9+
should be considered interchangeable.
10+
11+
# SYNOPSIS
12+
13+
trash [_option_]... _file_...
14+
15+
# DESCRIPTION
16+
17+
A near drop-in replacement for *rm*(1) that uses the FreeDesktop trash bin.
18+
Written in the D programming language using only D's Phobos standard library.
19+
20+
The options and flags are intended to mirror *rm*'s closely, with some
21+
additional long options for the *trash* specific features.
22+
23+
## Options
24+
25+
*-d*, *--dir*
26+
: Remove empty directories.
27+
28+
*-r*, *-R*, *--recursive*
29+
: Delete directories and their contents.
30+
31+
*-v*, *--verbose*
32+
: Print more information.
33+
34+
*-i*, *--interactive*
35+
: Ask before each deletion.
36+
37+
*-I*, *--interact-once*
38+
: Ask before deleting 3 or more files, or deleting recursively
39+
40+
*-f*, *--force*
41+
: Don't prompt and ignore errors.
42+
43+
*--version*
44+
: Output the version and exit.
45+
46+
*--list*
47+
: List out the files in the trash.
48+
49+
*--orphans*
50+
: List orphaned files in the trash.
51+
52+
*--delete* _file_
53+
: Delete a file from the trash.
54+
55+
*--restore* _file_
56+
: Restore a file from the trash.
57+
58+
*--empty*
59+
: Empty the trash bin.
60+
61+
*--rm* _files_...
62+
: Escape hatch to permanently delete a file.
63+
64+
*-h*, *--help*
65+
: This help information.
66+
67+
## Precedence
68+
69+
The *--help*, *--version*, *--list*, *--orphans*,
70+
*--restore*, *--delete*, and *--empty* flags all cause the program
71+
to short-circuit and perform only that operation and no others. Their
72+
precedence is in that order exactly, and is intended to cause the least
73+
destruction.
74+
75+
Therefore the command '`trash --empty --list`' will list the trash bin and NOT
76+
empty it.
77+
78+
*Note:* Before version 11 trash-d followed a slightly incorrect precedence
79+
order.
80+
81+
## Compatibility with *rm*(1)
82+
83+
One of trash-d's primary goals is near compatibility with the GNU *rm(1)*
84+
tool. The keyword here is "near". The goal is not exact flag-for-flag
85+
compatibility with *rm*, but you should be able to '`alias rm=trash`' and
86+
not notice the difference. But since *rm* has different failure states and
87+
error messages it can never be 100% compatible.
88+
89+
Additionally since there are a few different implementations of *rm(1)*
90+
(BSDs and so on) that are all subtly incompatible with each other I can't
91+
guarantee compatibility with all versions.
92+
93+
As of version 16 unknown options will throw an error. Prior to
94+
version 16 unknown options were silently ignored.
95+
96+
As of version 17 trash-d will not follow symlinks recursively through
97+
directories. This may in some cases be inconsistent with *rm* but errs on
98+
the side of not deleting your files.
99+
100+
# ENVIRONMENT
101+
102+
*XDG_DATA_HOME*
103+
This variable is used to determine where the default trash directory is for
104+
this user as per the FreeDesktop specification.
105+
106+
*TRASH_D_DIR*
107+
Override the trash directory to the specified path, useful for trashing on
108+
removable devices.
109+
110+
# FILES
111+
112+
*$XDG_DATA_HOME/Trash*
113+
Standard location of trash files and metadata as per the FreeDesktop
114+
specification. Used in the absence of *$TRASH_D_DIR*.
115+
116+
*~/.local/share/Trash*
117+
The fallback path used in the absence of both *$XDG_DATA_HOME* and
118+
*$TRASH_D_DIR*.
119+
120+
# EXIT STATUS
121+
122+
*trash* exits with the status code 0 on success, and >0 if an error occurs.
123+
124+
# SEE ALSO
125+
126+
*rm*(1), *user-dirs.conf*(5)
127+
128+
# STANDARDS
129+
130+
By mimicking *rm* this utility is partially POSIX compliant however this is
131+
*NOT* to be relied upon for any purpose.
132+
133+
trash-d is compliant with the FreeDesktop trash specification:
134+
https://specifications.freedesktop.org/trash-spec/trashspec-latest.html
135+
136+
# AUTHOR
137+
138+
Steven vanZyl <rushsteve1@rushsteve1.us>
139+
140+
The up-to-date sources can be found at: https://github.com/rushsteve1/trash-d
141+
142+
# BUGS
143+
144+
https://github.com/rushsteve1/trash-d/issues

0 commit comments

Comments
 (0)