Skip to main content

shep/
lib.rs

1//! `shep-cli`: clap command surface, output rendering, and the daemon
2//! launch/re-exec path behind the `shep` binary.
3//!
4//! The public API is three entry points, [`main`], [`main_runtime`] and
5//! [`main_dev`], one per `[[bin]]` target, each returning
6//! [`std::process::ExitCode`] for the binary that calls it. Everything else
7//! is private: embedding shep in another program is `shep-client`'s job.
8
9#![forbid(unsafe_code)]
10
11mod adopted;
12mod adopted_help;
13mod cli;
14mod client;
15mod commands;
16mod completions;
17mod config;
18mod dispatch;
19mod dog;
20mod dog_index;
21mod dog_settings;
22mod entry;
23mod exit;
24mod fetch;
25mod flourish;
26mod home;
27mod host;
28mod http;
29mod launch;
30mod lookout;
31mod output;
32mod remote;
33mod secret_readers;
34mod serve;
35mod shutdown;
36mod status;
37mod style;
38mod terminal_safe;
39mod version_guard;
40mod vocabulary;
41mod welcome;
42mod whistle;
43
44use entry::{alias_argv, run_argv};
45
46/// The `shep` entry point. Parses this process's arguments and runs one verb.
47///
48/// Returns rather than exiting: the caller's `main` owns the process exit, so
49/// the integration tier can call this without taking the harness down.
50#[must_use]
51pub fn main() -> std::process::ExitCode {
52    run_argv(std::env::args_os().collect())
53}
54
55/// The `shep-runtime` entry point: `shep runtime`, with the verb supplied.
56#[must_use]
57pub fn main_runtime() -> std::process::ExitCode {
58    run_argv(alias_argv("runtime", std::env::args_os().collect()))
59}
60
61/// The `shep-dev` entry point: `shep dev`, with the verb supplied.
62#[must_use]
63pub fn main_dev() -> std::process::ExitCode {
64    run_argv(alias_argv("dev", std::env::args_os().collect()))
65}