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