qsu

Check-in Differences
Login

Check-in Differences

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Difference From qsu-0.7.0 To trunk

2024-11-18
02:27
Use bin name. Leaf check-in: c581fba9b6 user: jan tags: trunk
01:38
Dependency management. check-in: 79a3106d9e user: jan tags: trunk
01:20
Add crate version to clap. check-in: 0bf34bcb4f user: jan tags: trunk
2024-10-17
14:57
Release maintenance. check-in: bdeb55f63b user: jan tags: qsu-0.7.0, trunk
14:52
Add missing bound. check-in: 150898a4e2 user: jan tags: trunk

Changes to Cargo.toml.

1
2
3

4
5
6
7
8
9
10
1
2

3
4
5
6
7
8
9
10


-
+







[package]
name = "qsu"
version = "0.7.0"
version = "0.7.1"
edition = "2021"
license = "0BSD"
# https://crates.io/category_slugs
categories = [ "os" ]
keywords = [ "service", "systemd", "winsvc" ]
repository = "https://repos.qrnch.tech/pub/qsu"
description = "Service subsystem utilities and runtime wrapper."
34
35
36
37
38
39
40
41

42
43
44
45
46
47
48
49
50
51
52


53
54
55
56
57
58
59
60
61
62
63
64
65

66
67
68
69
70
71


72
73
74
75
76
77
78
79
80
81


82
83
84
85
86
87
88
34
35
36
37
38
39
40

41
42
43
44
45
46
47
48
49
50


51
52
53
54
55
56
57
58
59
60
61
62
63
64

65
66
67
68
69


70
71
72
73
74
75
76
77
78
79


80
81
82
83
84
85
86
87
88







-
+









-
-
+
+












-
+




-
-
+
+








-
-
+
+







rt = []
tokio = ["rt", "tokio/macros", "tokio/rt-multi-thread", "tokio/signal"]
wait-for-debugger = ["dep:dbgtools-win"]

[dependencies]
async-trait = { version = "0.1.83" }
chrono = { version = "0.4.38" }
clap = { version = "4.5.20", optional = true, features = [
clap = { version = "4.5.21", optional = true, features = [
  "derive", "env", "string", "wrap_help"
] }
env_logger = { version = "0.11.5" }
futures = { version = "0.3.31" }
itertools = { version = "0.13.0", optional = true }
killswitch = { version = "0.4.2" }
log = { version = "0.4.22" }
parking_lot = { version = "0.12.3" }
rocket = { version = "0.5.1", optional = true }
sidoc = { version = "0.1.0", optional = true }
tokio = { version = "1.40.0", features = ["sync"] }
sidoc = { version = "0.1.1", optional = true }
tokio = { version = "1.41.1", features = ["sync"] }
time = { version = "0.3.36", features = ["macros"] }
tracing = { version = "0.1.40" }

[dependencies.tracing-subscriber]
version = "0.3.18"
default-features = false
features = ["env-filter", "time", "fmt", "ansi"]

[target.'cfg(target_os = "linux")'.dependencies]
sd-notify = { version = "0.4.3", optional = true }

[target.'cfg(unix)'.dependencies]
libc = { version = "0.2.160" }
libc = { version = "0.2.164" }
nix = { version = "0.29.0", features = ["pthread", "signal", "time"] }

[target.'cfg(windows)'.dependencies]
dbgtools-win = { version = "0.2.1", optional = true }
eventlog = { version = "0.2.2" }
registry = { version = "1.2.3" }
eventlog = { version = "0.3.0" }
registry = { version = "1.3.0" }
scopeguard = { version = "1.2.0" }
windows-service = { version = "0.7.0" }
windows-sys = { version = "0.59.0", features = [
  "Win32_Foundation", "Win32_System_Console"
] }
winreg = { version = "0.52.0" }

[dev-dependencies]
clap = { version = "4.5.20", features = ["derive", "env", "wrap_help"] }
tokio = { version = "1.40.0", features = ["time"] }
clap = { version = "4.5.21", features = ["derive", "env", "wrap_help"] }
tokio = { version = "1.41.1", features = ["time"] }

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"]

[[example]]
name = "hellosvc"

Changes to examples/argp/mod.rs.

1

2
3

4
5
6
7
8
9
10
11
12
















13
14
15
16
17
18
19

1
2

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
-
+

-
+









+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+







use clap::ArgMatches;
use clap::{ArgMatches, Command};

use qsu::{installer::RegSvc, rt::SrvAppRt};
use qsu::{argp::Cmd, installer::RegSvc, rt::SrvAppRt};

use crate::err::Error;

pub struct AppArgsProc {
  pub(crate) bldr: Box<dyn Fn() -> SrvAppRt<Error>>
}

impl qsu::argp::ArgsProc for AppArgsProc {
  type AppErr = Error;

  fn conf_cmd(
    &mut self,
    cmdtype: Cmd,
    cmd: Command
  ) -> Result<Command, Self::AppErr> {
    let cmd = if cmdtype == Cmd::Root {
      // tip: help_template() can be used to include version number in help
      cmd
        .name(env!("CARGO_BIN_NAME"))
        .version(env!("CARGO_PKG_VERSION"))
    } else {
      cmd
    };
    Ok(cmd)
  }

  /// Process an `register-service` subcommand.
  fn proc_inst(
    &mut self,
    _sub_m: &ArgMatches,
    regsvc: RegSvc
  ) -> Result<RegSvc, Self::AppErr> {

Changes to src/argp.rs.

249
250
251
252
253
254
255

256
257
258
259
260
261
262
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263







+







    Self { svcname }
  }
}


/// Used to differentiate between running without a subcommand, or the
/// install/uninstall or run service subcommands.
#[derive(Debug, PartialEq, Eq)]
pub enum Cmd {
  /// The root `Command`.
  Root,

  /// The service registration/installation `Command`.
  Inst,

Changes to www/changelog.md.

1
2
3
4
5
6
7
8
9


10
11
12
13
14
15
16
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18









+
+







# Change log

⚠️  indicates a breaking change.

## [Unreleased]

[Details](/vdiff?from=qsu-0.7.0&to=trunk)

### Added

- Derive `Debug`, `PartialEq` and `Eq` for `argp::Cmd`.

### Changed

### Removed

---