bssh/cli/mod.rs
1// Copyright 2025 Lablup Inc. and Jeongkyu Shin
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! CLI module for bssh
16//!
17//! This module provides command-line interface parsing for bssh, including:
18//! - Standard bssh CLI (`Cli`)
19//! - pdsh compatibility layer (`pdsh` submodule)
20//!
21//! # Architecture
22//!
23//! The CLI module is structured as follows:
24//! - `bssh.rs` - Main bssh CLI parser with all standard options
25//! - `pdsh.rs` - pdsh-compatible CLI parser for drop-in replacement mode
26//!
27//! # pdsh Compatibility Mode
28//!
29//! bssh can operate in pdsh compatibility mode, activated by:
30//! 1. Setting `BSSH_PDSH_COMPAT=1` environment variable
31//! 2. Symlinking bssh to "pdsh" and invoking via that name
32//! 3. Using the `--pdsh-compat` flag
33//!
34//! See the `pdsh` module documentation for details on option mapping.
35
36mod bssh;
37pub mod pdsh;
38
39#[cfg(test)]
40mod mode_detection_tests;
41
42// Re-export main CLI types from bssh module
43pub use bssh::{Cli, Commands};
44
45// Re-export pdsh compatibility utilities
46pub use pdsh::{
47 PDSH_COMPAT_ENV_VAR, PdshCli, QueryResult, has_pdsh_compat_flag, is_pdsh_compat_mode,
48 remove_pdsh_compat_flag,
49};