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
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
// Copyright (c) 2024
// SPDX-FileCopyrightText: 2024 - 2025 Ali Sajid Imami
//
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
//! # gh-bofh
//!
//! This is a binary crate that utilizes the `gh_bofh_lib` library to generate
//! random BOFH excuses. This crate is designed to be used as a plugin/extension for the [`gh`](https://cli.github.com/) CLI tool, but
//! can also be used as a standalone binary.
//!
//! The crate provides a CLI interface to generate random BOFH excuses. The
//! excuse type can be specified in multiple ways:
//!
//! * Using the `-t/--type` flag: this flag accepts two values: `classic` and
//! `modern`.
//! * Using the `EXCUSE_TYPE` environment variable: this variable accepts the
//! same values as the `-t/--type` flag.
//! * Using the `-c/--classic` flag: this flag generates a classic BOFH excuse.
//! * Using the `-m/--modern` flag: this flag generates a modern BOFH excuse.
//!
//! In case no flag or environment variable is specified, the default is to
//! generate a `classic` BOFH excuse.
use Parser;
use ;
use ;
/// Processes the choice of excuse type based on the CLI arguments.
///
/// If the `modern` flag is set (for example by using the `-m` or `--modern`
/// flag), the function returns `EXCUSE_TYPE::Modern`. Otherwise it defers to
/// the `excuse_type` field in the `Cli` struct as parsed by [`clap`].
const