refactor(app): clarify application and binary roles #124
No files matched your search
@@ -38,12 +38,14 @@ This installs:
|
|||||||
|
|
||||||
* `irtt-rs`, the canonical multi-applet dispatcher
|
* `irtt-rs`, the canonical multi-applet dispatcher
|
||||||
* `irtt-client`, the stream and text client
|
* `irtt-client`, the stream and text client
|
||||||
|
* `irtt-tui`, the terminal UI
|
||||||
* `irtt-server`, the UDP server
|
* `irtt-server`, the UDP server
|
||||||
|
|
||||||
To also install the optional terminal UI:
|
Each applet can also be built in isolation with `--no-default-features` plus
|
||||||
|
the applet's own feature. For example, a lightweight client-only install:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cargo install --path crates/irtt-app --features tui
|
cargo install --path crates/irtt-app --no-default-features --features client
|
||||||
```
|
```
|
||||||
|
|
||||||
## Quick start
|
## Quick start
|
||||||
@@ -311,13 +313,13 @@ synchronous callers. Callers that already own Tokio can drive
|
|||||||
|
|
||||||
## Binaries and features
|
## Binaries and features
|
||||||
|
|
||||||
| Build | Binaries |
|
| Build | Binaries |
|
||||||
| ----------------------------------------- | ------------------------------------------------- |
|
| -------------------------------------------- | --------------------------------------------------- |
|
||||||
| `--no-default-features` | `irtt-rs` |
|
| `--no-default-features` | `irtt-rs` |
|
||||||
| `--no-default-features --features server` | `irtt-rs`, `irtt-server` |
|
| `--no-default-features --features client` | `irtt-rs`, `irtt-client` |
|
||||||
| Default features | `irtt-rs`, `irtt-client`, `irtt-server` |
|
| `--no-default-features --features server` | `irtt-rs`, `irtt-server` |
|
||||||
| `--features tui` | `irtt-rs`, `irtt-client`, `irtt-server`, `irtt-tui` |
|
| `--no-default-features --features tui` | `irtt-rs`, `irtt-tui` |
|
||||||
| `--all-features` | `irtt-rs`, `irtt-client`, `irtt-server`, `irtt-tui` |
|
| Default features (or `--all-features`) | `irtt-rs`, `irtt-client`, `irtt-tui`, `irtt-server` |
|
||||||
|
|
||||||
`irtt-client` requires the `client` feature, `irtt-server` the `server` feature,
|
`irtt-client` requires the `client` feature, `irtt-server` the `server` feature,
|
||||||
and `irtt-tui` the `tui` feature. The `irtt-rs` dispatcher is always built, and
|
and `irtt-tui` the `tui` feature. The `irtt-rs` dispatcher is always built, and
|
||||||
|
|||||||
@@ -1,14 +1,10 @@
|
|||||||
use std::{
|
#[cfg(any(feature = "client", feature = "server", feature = "tui"))]
|
||||||
env,
|
use std::sync::{atomic::AtomicBool, Arc};
|
||||||
ffi::OsString,
|
use std::{env, ffi::OsString, process::ExitCode};
|
||||||
process::ExitCode,
|
|
||||||
sync::{atomic::AtomicBool, Arc},
|
|
||||||
};
|
|
||||||
|
|
||||||
use crate::{
|
use crate::applet::{dispatch_from_argv, AppletDispatch, RequestedApplet};
|
||||||
applet::{dispatch_from_argv, AppletDispatch, RequestedApplet},
|
#[cfg(any(feature = "client", feature = "server", feature = "tui"))]
|
||||||
signal::install_signal_handler,
|
use crate::signal::install_signal_handler;
|
||||||
};
|
|
||||||
|
|
||||||
/// Entry point for the `irtt-rs` multicall dispatcher binary.
|
/// Entry point for the `irtt-rs` multicall dispatcher binary.
|
||||||
///
|
///
|
||||||
@@ -81,6 +77,7 @@ fn run_dispatcher_from_env() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
|
|
||||||
/// Installs the shutdown signal handler shared by every applet and hands the
|
/// Installs the shutdown signal handler shared by every applet and hands the
|
||||||
/// resulting flag to `f`.
|
/// resulting flag to `f`.
|
||||||
|
#[cfg(any(feature = "client", feature = "server", feature = "tui"))]
|
||||||
fn with_shutdown_flag(
|
fn with_shutdown_flag(
|
||||||
f: impl FnOnce(&AtomicBool) -> Result<(), Box<dyn std::error::Error>>,
|
f: impl FnOnce(&AtomicBool) -> Result<(), Box<dyn std::error::Error>>,
|
||||||
) -> Result<(), Box<dyn std::error::Error>> {
|
) -> Result<(), Box<dyn std::error::Error>> {
|
||||||
|
|||||||
Reference in new issue
Block a user