Skip to main content

twc_rs/cli/
projects.rs

1// SPDX-FileCopyrightText: 2026 RAprogramm <andrey.rozanov.vl@gmail.com>
2// SPDX-License-Identifier: MIT
3
4//! Project subcommands.
5
6use clap::Subcommand;
7
8/// Project subcommands.
9#[derive(Subcommand, Debug)]
10pub enum ProjectCommands {
11    /// List all projects.
12    List,
13    /// Create a new project.
14    Create {
15        /// Project name (max 255 chars).
16        #[arg(long)]
17        name: String,
18
19        /// Project description (max 255 chars).
20        #[arg(long)]
21        description: Option<String>
22    },
23    /// Delete a project by ID.
24    Delete {
25        /// Project ID.
26        #[arg(long)]
27        id: i32
28    },
29    /// Update a project's name and/or description.
30    Set {
31        /// Project ID.
32        #[arg(long)]
33        id:          i32,
34        /// New project name (max 255 chars).
35        #[arg(long)]
36        name:        Option<String>,
37        /// New project description (max 255 chars).
38        #[arg(long)]
39        description: Option<String>
40    },
41    /// List all resources in a project.
42    Resources {
43        /// Project ID.
44        #[arg(long)]
45        id: i32
46    }
47}