1mod check_version;
2mod current;
3mod enterprise;
4mod generate;
5mod make_archive;
6mod mappings;
7mod members;
8mod org_graph;
9mod snapshot;
10
11use clap::Parser;
12
13#[derive(Debug, Parser)]
14#[remain::sorted]
15#[command(about = "a tool for populating GitHub Orgs from Okta Users/Groups")]
16pub enum Command {
17 CheckVersion(check_version::Command),
18 Current(current::Command),
19 #[command(subcommand)]
20 Enterprise(enterprise::Command),
21 Generate(generate::Command),
22 MakeArchive(make_archive::Command),
23 Mappings(mappings::Command),
24 Members(members::Command),
25 #[command(subcommand)]
26 OrgGraph(org_graph::Command),
27 Snapshot(snapshot::Command),
28}
29
30impl Command {
31 pub async fn run(self) -> Result<(), crate::Error> {
32 match self {
33 Self::CheckVersion(command) => command.run(),
34 Self::Current(command) => command.run(),
35 Self::Enterprise(command) => command.run().await,
36 Self::Generate(command) => command.run(),
37 Self::MakeArchive(command) => command.run(),
38 Self::Mappings(command) => command.run(),
39 Self::Members(command) => command.run().await,
40 Self::OrgGraph(command) => command.run(),
41 Self::Snapshot(command) => command.run(),
42 }
43 }
44}