openstack_tui/
cli.rs

1// Licensed under the Apache License, Version 2.0 (the "License");
2// you may not use this file except in compliance with the License.
3// You may obtain a copy of the License at
4//
5//     http://www.apache.org/licenses/LICENSE-2.0
6//
7// Unless required by applicable law or agreed to in writing, software
8// distributed under the License is distributed on an "AS IS" BASIS,
9// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10// See the License for the specific language governing permissions and
11// limitations under the License.
12//
13// SPDX-License-Identifier: Apache-2.0
14//! TUI Cli parameters
15use clap::{Parser, ValueHint};
16use std::path::PathBuf;
17
18use crate::utils::version;
19
20/// TUI Cli parameters
21#[derive(Parser, Debug)]
22#[command(author, version = version(), about)]
23pub struct Cli {
24    /// Number of ticks per second. May be used by certain views to trigger certain actions, but
25    /// most likely not used.
26    #[arg(short, long, value_name = "FLOAT", default_value_t = 0.2)]
27    pub tick_rate: f64,
28
29    /// Refresh frame rate (number of frames per second)
30    #[arg(short, long, value_name = "FLOAT", default_value_t = 1.0)]
31    pub frame_rate: f64,
32
33    /// Cloud name to connect to after the start
34    #[arg(long, env = "OS_CLOUD")]
35    pub os_cloud: Option<String>,
36
37    /// Custom path to the `clouds.yaml` config file
38    #[arg(long, env = "OS_CLIENT_CONFIG_FILE", value_hint = ValueHint::FilePath)]
39    pub os_client_config_file: Option<PathBuf>,
40
41    /// Custom path to the `secure.yaml` config file
42    #[arg(long, env = "OS_CLIENT_SECURE_FILE", value_hint = ValueHint::FilePath)]
43    pub os_client_secure_file: Option<PathBuf>,
44}