Skip to content

Commit f92a3e9

Browse files
committed
release: 0.16.1
2 parents 98e932f + 1c583cc commit f92a3e9

9 files changed

Lines changed: 149 additions & 101 deletions

File tree

CREDITS.md

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,76 @@
11
# Project Dependencies
22
Package: adbyss
3-
Version: 0.16.0
3+
Version: 0.16.1
44
Target: x86_64-unknown-linux-gnu
5-
Generated: 2025-02-26 04:02:33 UTC
5+
Generated: 2025-04-03 19:36:36 UTC
66

77
| Package | Version | Author(s) | License |
88
| ---- | ---- | ---- | ---- |
9-
| [**adbyss_psl**](https://github.com/Blobfolio/adbyss) | 0.16.0 | [Josh Stoik](mailto:josh@blobfolio.com) | WTFPL |
9+
| [**adbyss_psl**](https://github.com/Blobfolio/adbyss) | 0.16.1 | [Josh Stoik](mailto:josh@blobfolio.com) | WTFPL |
1010
| [aho-corasick](https://github.com/BurntSushi/aho-corasick) | 1.1.3 | [Andrew Gallant](mailto:jamslam@gmail.com) | Unlicense OR MIT |
11-
| [anyhow](https://github.com/dtolnay/anyhow) | 1.0.96 | [David Tolnay](mailto:dtolnay@gmail.com) | MIT OR Apache-2.0 |
12-
| [**argyle**](https://github.com/Blobfolio/argyle) | 0.11.0 | [Josh Stoik](mailto:josh@blobfolio.com) | WTFPL |
13-
| [bitflags](https://github.com/bitflags/bitflags) | 2.8.0 | The Rust Project Developers | MIT OR Apache-2.0 |
14-
| [cc](https://github.com/rust-lang/cc-rs) ⚒️ | 1.2.15 | [Alex Crichton](mailto:alex@alexcrichton.com) | MIT OR Apache-2.0 |
11+
| [anyhow](https://github.com/dtolnay/anyhow) | 1.0.97 | [David Tolnay](mailto:dtolnay@gmail.com) | MIT OR Apache-2.0 |
12+
| [**argyle**](https://github.com/Blobfolio/argyle) | 0.12.3 | [Josh Stoik](mailto:josh@blobfolio.com) | WTFPL |
13+
| [bitflags](https://github.com/bitflags/bitflags) | 2.9.0 | The Rust Project Developers | MIT OR Apache-2.0 |
14+
| [cc](https://github.com/rust-lang/cc-rs) ⚒️ | 1.2.17 | [Alex Crichton](mailto:alex@alexcrichton.com) | MIT OR Apache-2.0 |
1515
| [cfg-if](https://github.com/alexcrichton/cfg-if) | 1.0.0 | [Alex Crichton](mailto:alex@alexcrichton.com) | MIT OR Apache-2.0 |
1616
| [cfg_aliases](https://github.com/katharostech/cfg_aliases) ⚒️ | 0.2.1 | [Zicklag](mailto:zicklag@katharostech.com) | MIT |
17-
| [**dactyl**](https://github.com/Blobfolio/dactyl) | 0.10.0 | [Josh Stoik](mailto:josh@blobfolio.com) | WTFPL |
17+
| [**dactyl**](https://github.com/Blobfolio/dactyl) | 0.10.1 | [Josh Stoik](mailto:josh@blobfolio.com) | WTFPL |
1818
| [displaydoc](https://github.com/yaahc/displaydoc) | 0.2.5 | [Jane Lusby](mailto:jlusby@yaah.dev) | MIT OR Apache-2.0 |
1919
| [equivalent](https://github.com/indexmap-rs/equivalent) | 1.0.2 | | Apache-2.0 OR MIT |
2020
| [fastrand](https://github.com/smol-rs/fastrand) | 2.3.0 | [Stjepan Glavina](mailto:stjepang@gmail.com) | Apache-2.0 OR MIT |
21-
| [**fyi_msg**](https://github.com/Blobfolio/fyi) | 1.7.1 | [Josh Stoik](mailto:josh@blobfolio.com) | WTFPL |
21+
| [**fyi_msg**](https://github.com/Blobfolio/fyi) | 2.0.0 | [Josh Stoik](mailto:josh@blobfolio.com) | WTFPL |
2222
| [getrandom](https://github.com/rust-random/getrandom) | 0.2.15 | The Rand Project Developers | MIT OR Apache-2.0 |
23-
| [getrandom](https://github.com/rust-random/getrandom) | 0.3.1 | The Rand Project Developers | MIT OR Apache-2.0 |
23+
| [getrandom](https://github.com/rust-random/getrandom) | 0.3.2 | The Rand Project Developers | MIT OR Apache-2.0 |
2424
| [hashbrown](https://github.com/rust-lang/hashbrown) | 0.15.2 | [Amanieu d'Antras](mailto:amanieu@gmail.com) | MIT OR Apache-2.0 |
2525
| [icu_collections](https://github.com/unicode-org/icu4x) | 1.5.0 | The ICU4X Project Developers | Unicode-3.0 |
2626
| [icu_locid](https://github.com/unicode-org/icu4x) | 1.5.0 | The ICU4X Project Developers | Unicode-3.0 |
2727
| [icu_locid_transform](https://github.com/unicode-org/icu4x) | 1.5.0 | The ICU4X Project Developers | Unicode-3.0 |
28-
| [icu_locid_transform_data](https://github.com/unicode-org/icu4x) | 1.5.0 | The ICU4X Project Developers | Unicode-3.0 |
28+
| [icu_locid_transform_data](https://github.com/unicode-org/icu4x) | 1.5.1 | The ICU4X Project Developers | Unicode-3.0 |
2929
| [icu_normalizer](https://github.com/unicode-org/icu4x) | 1.5.0 | The ICU4X Project Developers | Unicode-3.0 |
30-
| [icu_normalizer_data](https://github.com/unicode-org/icu4x) | 1.5.0 | The ICU4X Project Developers | Unicode-3.0 |
30+
| [icu_normalizer_data](https://github.com/unicode-org/icu4x) | 1.5.1 | The ICU4X Project Developers | Unicode-3.0 |
3131
| [icu_properties](https://github.com/unicode-org/icu4x) | 1.5.1 | The ICU4X Project Developers | Unicode-3.0 |
32-
| [icu_properties_data](https://github.com/unicode-org/icu4x) | 1.5.0 | The ICU4X Project Developers | Unicode-3.0 |
32+
| [icu_properties_data](https://github.com/unicode-org/icu4x) | 1.5.1 | The ICU4X Project Developers | Unicode-3.0 |
3333
| [icu_provider](https://github.com/unicode-org/icu4x) | 1.5.0 | The ICU4X Project Developers | Unicode-3.0 |
3434
| [icu_provider_macros](https://github.com/unicode-org/icu4x) | 1.5.0 | The ICU4X Project Developers | Unicode-3.0 |
3535
| [**idna**](https://github.com/servo/rust-url/) | 1.0.3 | The rust-url developers | MIT OR Apache-2.0 |
3636
| [idna_adapter](https://github.com/hsivonen/idna_adapter) | 1.2.0 | The rust-url developers | Apache-2.0 OR MIT |
37-
| [indexmap](https://github.com/indexmap-rs/indexmap) | 2.7.1 | | Apache-2.0 OR MIT |
38-
| [itoa](https://github.com/dtolnay/itoa) | 1.0.14 | [David Tolnay](mailto:dtolnay@gmail.com) | MIT OR Apache-2.0 |
39-
| [libc](https://github.com/rust-lang/libc) | 0.2.170 | The Rust Project Developers | MIT OR Apache-2.0 |
37+
| [indexmap](https://github.com/indexmap-rs/indexmap) | 2.8.0 | | Apache-2.0 OR MIT |
38+
| [itoa](https://github.com/dtolnay/itoa) | 1.0.15 | [David Tolnay](mailto:dtolnay@gmail.com) | MIT OR Apache-2.0 |
39+
| [libc](https://github.com/rust-lang/libc) | 0.2.171 | The Rust Project Developers | MIT OR Apache-2.0 |
4040
| [libyml](https://github.com/sebastienrousseau/libyml) | 0.0.5 | LibYML Contributors | MIT |
41-
| [linux-raw-sys](https://github.com/sunfishcode/linux-raw-sys) | 0.4.15 | [Dan Gohman](mailto:dev@sunfishcode.online) | Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT |
42-
| [litemap](https://github.com/unicode-org/icu4x) | 0.7.4 | The ICU4X Project Developers | Unicode-3.0 |
43-
| [log](https://github.com/rust-lang/log) | 0.4.26 | The Rust Project Developers | MIT OR Apache-2.0 |
41+
| [linux-raw-sys](https://github.com/sunfishcode/linux-raw-sys) | 0.9.3 | [Dan Gohman](mailto:dev@sunfishcode.online) | Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT |
42+
| [litemap](https://github.com/unicode-org/icu4x) | 0.7.5 | The ICU4X Project Developers | Unicode-3.0 |
43+
| [log](https://github.com/rust-lang/log) | 0.4.27 | The Rust Project Developers | MIT OR Apache-2.0 |
4444
| [memchr](https://github.com/BurntSushi/memchr) | 2.7.4 | [Andrew Gallant](mailto:jamslam@gmail.com) and bluss | Unlicense OR MIT |
45-
| [**minreq**](https://github.com/neonmoe/minreq) | 2.13.2 | [Jens Pitkanen](mailto:jens@neon.moe) | ISC |
45+
| [**minreq**](https://github.com/neonmoe/minreq) | 2.13.3 | [Jens Pitkanen](mailto:jens@neon.moe) | ISC |
4646
| [**nix**](https://github.com/nix-rust/nix) | 0.29.0 | The nix-rust Project Developers | MIT |
47-
| [once_cell](https://github.com/matklad/once_cell) | 1.20.3 | [Aleksey Kladov](mailto:aleksey.kladov@gmail.com) | MIT OR Apache-2.0 |
48-
| [proc-macro2](https://github.com/dtolnay/proc-macro2) | 1.0.93 | [David Tolnay](mailto:dtolnay@gmail.com) and [Alex Crichton](mailto:alex@alexcrichton.com) | MIT OR Apache-2.0 |
49-
| [quote](https://github.com/dtolnay/quote) | 1.0.38 | [David Tolnay](mailto:dtolnay@gmail.com) | MIT OR Apache-2.0 |
47+
| [once_cell](https://github.com/matklad/once_cell) | 1.21.3 | [Aleksey Kladov](mailto:aleksey.kladov@gmail.com) | MIT OR Apache-2.0 |
48+
| [proc-macro2](https://github.com/dtolnay/proc-macro2) | 1.0.94 | [David Tolnay](mailto:dtolnay@gmail.com) and [Alex Crichton](mailto:alex@alexcrichton.com) | MIT OR Apache-2.0 |
49+
| [quote](https://github.com/dtolnay/quote) | 1.0.40 | [David Tolnay](mailto:dtolnay@gmail.com) | MIT OR Apache-2.0 |
5050
| [**regex**](https://github.com/rust-lang/regex) | 1.11.1 | The Rust Project Developers and [Andrew Gallant](mailto:jamslam@gmail.com) | MIT OR Apache-2.0 |
5151
| [regex-automata](https://github.com/rust-lang/regex/tree/master/regex-automata) | 0.4.9 | The Rust Project Developers and [Andrew Gallant](mailto:jamslam@gmail.com) | MIT OR Apache-2.0 |
5252
| [regex-syntax](https://github.com/rust-lang/regex/tree/master/regex-syntax) | 0.8.5 | The Rust Project Developers and [Andrew Gallant](mailto:jamslam@gmail.com) | MIT OR Apache-2.0 |
53-
| [ring](https://github.com/ctz/ring) | 0.17.11 | | Apache-2.0 AND ISC |
54-
| [rustix](https://github.com/bytecodealliance/rustix) | 0.38.44 | [Dan Gohman](mailto:dev@sunfishcode.online) and [Jakub Konka](mailto:kubkon@jakubkonka.com) | Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT |
53+
| [ring](https://github.com/briansmith/ring) | 0.17.14 | | Apache-2.0 AND ISC |
54+
| [rustix](https://github.com/bytecodealliance/rustix) | 1.0.5 | [Dan Gohman](mailto:dev@sunfishcode.online) and [Jakub Konka](mailto:kubkon@jakubkonka.com) | Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT |
5555
| [rustls](https://github.com/rustls/rustls) | 0.21.12 | | Apache-2.0 OR ISC OR MIT |
5656
| [rustls-webpki](https://github.com/rustls/webpki) | 0.101.7 | | ISC |
57-
| [ryu](https://github.com/dtolnay/ryu) | 1.0.19 | [David Tolnay](mailto:dtolnay@gmail.com) | Apache-2.0 OR BSL-1.0 |
57+
| [ryu](https://github.com/dtolnay/ryu) | 1.0.20 | [David Tolnay](mailto:dtolnay@gmail.com) | Apache-2.0 OR BSL-1.0 |
5858
| [sct](https://github.com/rustls/sct.rs) | 0.7.1 | [Joseph Birr-Pixton](mailto:jpixton@gmail.com) | Apache-2.0 OR ISC OR MIT |
59-
| [**serde**](https://github.com/serde-rs/serde) | 1.0.218 | [Erick Tryzelaar](mailto:erick.tryzelaar@gmail.com) and [David Tolnay](mailto:dtolnay@gmail.com) | MIT OR Apache-2.0 |
60-
| [serde_derive](https://github.com/serde-rs/serde) | 1.0.218 | [Erick Tryzelaar](mailto:erick.tryzelaar@gmail.com) and [David Tolnay](mailto:dtolnay@gmail.com) | MIT OR Apache-2.0 |
61-
| [**serde_json**](https://github.com/serde-rs/json) ⚒️ | 1.0.139 | [Erick Tryzelaar](mailto:erick.tryzelaar@gmail.com) and [David Tolnay](mailto:dtolnay@gmail.com) | MIT OR Apache-2.0 |
59+
| [**serde**](https://github.com/serde-rs/serde) | 1.0.219 | [Erick Tryzelaar](mailto:erick.tryzelaar@gmail.com) and [David Tolnay](mailto:dtolnay@gmail.com) | MIT OR Apache-2.0 |
60+
| [serde_derive](https://github.com/serde-rs/serde) | 1.0.219 | [Erick Tryzelaar](mailto:erick.tryzelaar@gmail.com) and [David Tolnay](mailto:dtolnay@gmail.com) | MIT OR Apache-2.0 |
61+
| [**serde_json**](https://github.com/serde-rs/json) ⚒️ | 1.0.140 | [Erick Tryzelaar](mailto:erick.tryzelaar@gmail.com) and [David Tolnay](mailto:dtolnay@gmail.com) | MIT OR Apache-2.0 |
6262
| [**serde_yml**](https://github.com/sebastienrousseau/serde_yml) | 0.0.12 | Serde YML Contributors | MIT OR Apache-2.0 |
6363
| [shlex](https://github.com/comex/rust-shlex) ⚒️ | 1.3.0 | [comex](mailto:comexk@gmail.com), [Fenhl](mailto:fenhl@fenhl.net), [Adrian Taylor](mailto:adetaylor@chromium.org), [Alex Touchet](mailto:alextouchet@outlook.com), [Daniel Parks](mailto:dp+git@oxidized.org), and [Garrett Berg](mailto:googberg@gmail.com) | MIT OR Apache-2.0 |
6464
| [smallvec](https://github.com/servo/rust-smallvec) | 1.14.0 | The Servo Project Developers | MIT OR Apache-2.0 |
6565
| [stable_deref_trait](https://github.com/storyyeller/stable_deref_trait) | 1.2.0 | [Robert Grosse](mailto:n210241048576@gmail.com) | MIT OR Apache-2.0 |
66-
| [syn](https://github.com/dtolnay/syn) | 2.0.98 | [David Tolnay](mailto:dtolnay@gmail.com) | MIT OR Apache-2.0 |
66+
| [syn](https://github.com/dtolnay/syn) | 2.0.100 | [David Tolnay](mailto:dtolnay@gmail.com) | MIT OR Apache-2.0 |
6767
| [synstructure](https://github.com/mystor/synstructure) | 0.13.1 | [Nika Layzell](mailto:nika@thelayzells.com) | MIT |
68-
| [tempfile](https://github.com/Stebalien/tempfile) | 3.17.1 | [Steven Allen](mailto:steven@stebalien.com), The Rust Project Developers, [Ashley Mannix](mailto:ashleymannix@live.com.au), and [Jason White](mailto:me@jasonwhite.io) | MIT OR Apache-2.0 |
68+
| [tempfile](https://github.com/Stebalien/tempfile) | 3.19.1 | [Steven Allen](mailto:steven@stebalien.com), The Rust Project Developers, [Ashley Mannix](mailto:ashleymannix@live.com.au), and [Jason White](mailto:me@jasonwhite.io) | MIT OR Apache-2.0 |
6969
| [tinystr](https://github.com/unicode-org/icu4x) | 0.7.6 | The ICU4X Project Developers | Unicode-3.0 |
7070
| [**trimothy**](https://github.com/Blobfolio/trimothy) | 0.7.0 | [Josh Stoik](mailto:josh@blobfolio.com) | WTFPL |
71-
| [unicode-ident](https://github.com/dtolnay/unicode-ident) | 1.0.17 | [David Tolnay](mailto:dtolnay@gmail.com) | (MIT OR Apache-2.0) AND Unicode-3.0 |
71+
| [unicode-ident](https://github.com/dtolnay/unicode-ident) | 1.0.18 | [David Tolnay](mailto:dtolnay@gmail.com) | (MIT OR Apache-2.0) AND Unicode-3.0 |
7272
| [untrusted](https://github.com/briansmith/untrusted) | 0.9.0 | [Brian Smith](mailto:brian@briansmith.org) | ISC |
73-
| [**utc2k**](https://github.com/Blobfolio/utc2k) | 0.12.0 | [Josh Stoik](mailto:josh@blobfolio.com) | WTFPL |
73+
| [**utc2k**](https://github.com/Blobfolio/utc2k) | 0.12.1 | [Josh Stoik](mailto:josh@blobfolio.com) | WTFPL |
7474
| [utf16_iter](https://github.com/hsivonen/utf16_iter) | 1.0.5 | [Henri Sivonen](mailto:hsivonen@hsivonen.fi) | Apache-2.0 OR MIT |
7575
| [utf8_iter](https://github.com/hsivonen/utf8_iter) | 1.0.4 | [Henri Sivonen](mailto:hsivonen@hsivonen.fi) | Apache-2.0 OR MIT |
7676
| [version_check](https://github.com/SergioBenitez/version_check) ⚒️ | 0.9.5 | [Sergio Benitez](mailto:sb@sergio.bz) | MIT OR Apache-2.0 |
@@ -80,8 +80,8 @@
8080
| [writeable](https://github.com/unicode-org/icu4x) | 0.5.5 | The ICU4X Project Developers | Unicode-3.0 |
8181
| [yoke](https://github.com/unicode-org/icu4x) | 0.7.5 | [Manish Goregaokar](mailto:manishsmail@gmail.com) | Unicode-3.0 |
8282
| [yoke-derive](https://github.com/unicode-org/icu4x) | 0.7.5 | [Manish Goregaokar](mailto:manishsmail@gmail.com) | Unicode-3.0 |
83-
| [zerofrom](https://github.com/unicode-org/icu4x) | 0.1.5 | [Manish Goregaokar](mailto:manishsmail@gmail.com) | Unicode-3.0 |
84-
| [zerofrom-derive](https://github.com/unicode-org/icu4x) | 0.1.5 | [Manish Goregaokar](mailto:manishsmail@gmail.com) | Unicode-3.0 |
83+
| [zerofrom](https://github.com/unicode-org/icu4x) | 0.1.6 | [Manish Goregaokar](mailto:manishsmail@gmail.com) | Unicode-3.0 |
84+
| [zerofrom-derive](https://github.com/unicode-org/icu4x) | 0.1.6 | [Manish Goregaokar](mailto:manishsmail@gmail.com) | Unicode-3.0 |
8585
| [zerovec](https://github.com/unicode-org/icu4x) | 0.10.4 | The ICU4X Project Developers | Unicode-3.0 |
8686
| [zerovec-derive](https://github.com/unicode-org/icu4x) | 0.10.3 | [Manish Goregaokar](mailto:manishsmail@gmail.com) | Unicode-3.0 |
8787

adbyss/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "adbyss"
3-
version = "0.16.0"
3+
version = "0.16.1"
44
license = "WTFPL"
55
authors = ["Josh Stoik <josh@blobfolio.com>"]
66
edition = "2024"
@@ -89,9 +89,9 @@ items = [
8989
]
9090

9191
[dependencies]
92-
argyle = "0.11.*"
92+
argyle = "0.12.*"
9393
dactyl = "0.10.*"
94-
fyi_msg = "1.7.*"
94+
fyi_msg = "2.0.*"
9595
regex = "1.11.*"
9696
serde_yml = "=0.0.12"
9797
trimothy = "0.7.*"
@@ -117,4 +117,4 @@ version = "1.0.*"
117117
features = [ "derive" ]
118118

119119
[build-dependencies]
120-
argyle = "0.11.*"
120+
argyle = "0.12.*"

adbyss/build.rs

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,24 @@
22
# Adbyss: Build
33
*/
44

5-
use argyle::KeyWordsBuilder;
5+
use argyle::{
6+
FlagsBuilder,
7+
KeyWordsBuilder,
8+
};
69
use std::path::PathBuf;
710

811

912

10-
/// # Set Up CLI Arguments.
13+
/// # Set Up CLI Arguments and Flags.
1114
pub fn main() {
1215
println!("cargo:rerun-if-env-changed=CARGO_PKG_VERSION");
1316

17+
build_cli();
18+
build_flags();
19+
}
20+
21+
/// # Build CLI Args.
22+
fn build_cli() {
1423
let mut builder = KeyWordsBuilder::default();
1524
builder.push_keys([
1625
"--disable",
@@ -26,6 +35,19 @@ pub fn main() {
2635
builder.save(out_path("argyle.rs"));
2736
}
2837

38+
/// # Build Flags.
39+
fn build_flags() {
40+
FlagsBuilder::new("Flags")
41+
.private()
42+
.with_flag("Disable", Some("# Disable Shitlist."))
43+
.with_flag("Quiet", None)
44+
.with_flag("Show", Some("# Show Only."))
45+
.with_flag("Stdout", Some("# Print to STDOUT."))
46+
.with_complex_flag("Systemd", ["Yes"], Some("# Systemd Use.\n\nImplies `--yes`."))
47+
.with_flag("Yes", Some("# Assume Yes (Don't Prompt)."))
48+
.save(out_path("flags.rs"));
49+
}
50+
2951
/// # Output Path.
3052
///
3153
/// Append the sub-path to OUT_DIR and return it.

adbyss/src/main.rs

Lines changed: 22 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -78,23 +78,10 @@ use std::{
7878

7979

8080

81-
/// # CLI: Disable Shitlist.
82-
const CLI_DISABLE: u8 = 0b0000_0001;
81+
// Flags enum is generated by build.rs.
82+
include!(concat!(env!("OUT_DIR"), "/flags.rs"));
8383

84-
/// # CLI: Quiet.
85-
const CLI_QUIET: u8 = 0b0000_0010;
8684

87-
/// # CLI: Show Only.
88-
const CLI_SHOW: u8 = 0b0000_0100;
89-
90-
/// # CLI: To STDOUT.
91-
const CLI_STDOUT: u8 = 0b0000_1000;
92-
93-
/// # CLI: Systemd Mode.
94-
const CLI_SYSTEMD: u8 = 0b0011_0000; // Implies yes.
95-
96-
/// # CLI: Yes to Prompts.
97-
const CLI_YES: u8 = 0b0010_0000;
9885

9986
/// # Maximum Host Line.
10087
///
@@ -130,25 +117,23 @@ fn main__() -> Result<(), AdbyssError> {
130117

131118
// See what we've got!
132119
let mut config = None;
133-
let mut flags = 0_u8;
120+
let mut flags = Flags::None;
134121
for arg in args {
135122
match arg {
136-
Argument::Key("--disable") => { flags |= CLI_DISABLE; },
137-
Argument::Key("-q" | "--quiet") => { flags |= CLI_QUIET; },
138-
Argument::Key("--show") => { flags |= CLI_SHOW; },
139-
Argument::Key("--stdout") => { flags |= CLI_STDOUT; },
140-
Argument::Key("--systemd") => { flags |= CLI_SYSTEMD; },
141-
Argument::Key("-y" | "--yes") => { flags |= CLI_YES; },
123+
Argument::Key("--disable") => { flags.set(Flags::Disable); },
124+
Argument::Key("-q" | "--quiet") => { flags.set(Flags::Quiet); },
125+
Argument::Key("--show") => { flags.set(Flags::Show); },
126+
Argument::Key("--stdout") => { flags.set(Flags::Stdout); },
127+
Argument::Key("--systemd") => { flags.set(Flags::Systemd); },
128+
Argument::Key("-y" | "--yes") => { flags.set(Flags::Yes); },
142129

143130
Argument::Key("-h" | "--help") => return Err(AdbyssError::PrintHelp),
144131
Argument::Key("-V" | "--version") => return Err(AdbyssError::PrintVersion),
145132

146133
Argument::KeyWithValue("-c" | "--config", s) => { config.replace(s); },
147134

148135
// Nothing else is expected.
149-
Argument::Other(s) => if s.starts_with('-') {
150-
return Err(AdbyssError::InvalidCli(s));
151-
},
136+
Argument::Other(s) => return Err(AdbyssError::InvalidCli(s)),
152137
Argument::InvalidUtf8(s) => return Err(AdbyssError::InvalidCli(s.to_string_lossy().into_owned())),
153138
_ => {},
154139
}
@@ -163,15 +148,15 @@ fn main__() -> Result<(), AdbyssError> {
163148
else { Settings::default() };
164149

165150
// Remove everything?
166-
if CLI_DISABLE == flags & CLI_DISABLE {
167-
return settings.unwrite(CLI_YES == flags & CLI_YES);
151+
if flags.contains(Flags::Disable) {
152+
return settings.unwrite(flags.contains(Flags::Yes));
168153
}
169154

170155
// Make sure we're online if any sources other than our own are enabled.
171156
if settings.needs_internet() { check_internet()?; }
172157

173158
// Just print the domains.
174-
if CLI_SHOW == flags & CLI_SHOW {
159+
if flags.contains(Flags::Show) {
175160
let shitlist = settings.shitlist()?.into_vec();
176161
if shitlist.is_empty() { return Err(AdbyssError::NoShitlist); }
177162

@@ -180,29 +165,27 @@ fn main__() -> Result<(), AdbyssError> {
180165
let _res = handle.flush();
181166
}
182167
// Build the shitlist, but print it instead of saving it.
183-
else if CLI_STDOUT == flags & CLI_STDOUT {
168+
else if flags.contains(Flags::Stdout) {
184169
let (out, _) = settings.build()?;
185170
let mut handle = std::io::stdout().lock();
186171
let _res = handle.write_all(out.as_bytes()).and_then(|()| handle.flush());
187172
}
188173
// Actually write the changes to the host file!
189174
else {
190-
let len = settings.write(CLI_YES == flags & CLI_YES)?;
175+
let len = settings.write(flags.contains(Flags::Yes))?;
191176

192177
// Summarize what we've done.
193-
if CLI_SYSTEMD == flags & CLI_SYSTEMD {
178+
if flags.contains(Flags::Systemd) {
194179
println!(
195180
"{} unique hosts have been cast to a blackhole!",
196181
NiceU64::from(len),
197182
);
198183
}
199-
else if 0 == flags & CLI_QUIET {
200-
Msg::success(
201-
format!(
202-
"{} unique hosts have been cast to a blackhole!",
203-
NiceU64::from(len),
204-
)
205-
).print();
184+
else if ! flags.contains(Flags::Quiet) {
185+
Msg::success(format!(
186+
"{} unique hosts have been cast to a blackhole!",
187+
NiceU64::from(len),
188+
)).print();
206189
}
207190
}
208191

@@ -268,8 +251,7 @@ fn require_root() -> Result<(), AdbyssError> {
268251
.map_err(|_| AdbyssError::Root)?;
269252

270253
// Wait to see what happens.
271-
let exit = child.wait()
272-
.map_err(|_| AdbyssError::Root)?;
254+
let exit = child.wait().map_err(|_| AdbyssError::Root)?;
273255

274256
// Exit this (the old) instance with an appropriate code.
275257
std::process::exit(

0 commit comments

Comments
 (0)