Skip to main content

sem_tool/
lib.rs

1//! SPDX-License-Identifier: Apache-2.0
2//! Copyright 2025 canardleteer
3//!
4//! Licensed under the Apache License, Version 2.0 (the "License");
5//! you may not use this file except in compliance with the License.
6//! You may obtain a copy of the License at
7//!
8//! http://www.apache.org/licenses/LICENSE-2.0
9//!
10//! Unless required by applicable law or agreed to in writing, software
11//! distributed under the License is distributed on an "AS IS" BASIS,
12//! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13//! See the License for the specific language governing permissions and
14//! limitations under the License.
15
16//! `sem-tool` is a CLI application. This crate root exists so integration tests
17//! can share a small amount of logic with the implementation; it is not a
18//! supported library API.
19
20mod cli;
21mod misc;
22mod regex;
23mod results;
24
25use std::error::Error;
26use std::process::{ExitCode, Termination};
27
28/// Entry point for the `sem-tool` binary.
29#[doc(hidden)]
30pub fn run() -> Result<ExitCode, Box<dyn Error>> {
31    cli::run().map(|outcome| outcome.report())
32}
33
34/// Hidden exports for integration tests only.
35#[doc(hidden)]
36pub mod test_support {
37    pub use crate::results::{
38        compare_exit_code, ordering_pair_to_exit_code, version_without_build_metadata,
39    };
40}