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
use clap::{Parser, Subcommand};
#[derive(Parser)]
#[command(
name = "ghpending",
about = "Digest of open issues and PRs across watched repos"
)]
pub struct Cli {
#[command(subcommand)]
pub command: Option<Commands>,
/// Color theme (default, evangelion, nerv)
#[arg(long, global = true)]
pub theme: Option<String>,
/// Maximum items to show across all repos, allocated proportionally
#[arg(long, value_name = "COUNT")]
pub limit: Option<usize>,
/// Only show items you are subscribed to (requires GITHUB_TOKEN)
#[arg(long)]
pub subscribed: bool,
/// Repo sort order (activity, name, count, stale)
#[arg(long, value_name = "MODE")]
pub sort: Option<String>,
}
#[derive(Subcommand)]
pub enum Commands {
/// Pick repos from a GitHub user/org to track
Add {
/// GitHub user/org to list repos from; replaces the saved one.
/// Lists private repos too when it's your own account or an org you
/// belong to (needs a GITHUB_TOKEN with `repo` scope).
#[arg(long, conflicts_with = "all")]
user: Option<String>,
/// List every repo your token can reach (owned, collaborator and
/// org-member), private included, ignoring the saved user.
#[arg(long)]
all: bool,
},
/// Remove repos from the watch list
Rm,
/// Print all tracked repos
List,
}