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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
use clap::{arg, command, value_parser, Arg, Command as CliCommand};
pub fn create_commands() -> CliCommand {
command!()
.about("tpt")
.subcommand(
CliCommand::new("describe")
.about("Describe pipeline tasks or edges")
.arg_required_else_help(true)
.subcommand(CliCommand::new("tasks").about("Displays tasks as JSON"))
.subcommand(CliCommand::new("edges").about("Displays edges as JSON"))
.subcommand(CliCommand::new("hash").about("Displays hash as JSON"))
.subcommand(CliCommand::new("options").about("Displays options as JSON")),
)
.subcommand(CliCommand::new("check").about("Check for circular depencencies"))
.subcommand(
CliCommand::new("graph")
.about("Displays graph")
.arg_required_else_help(true)
.arg(
arg!(
[graph_type] "Type of graph to output"
)
.required(true)
.value_parser(value_parser!(String))
.default_values(["mermaid", "graphite"])
.default_missing_value("mermaid"),
),
)
.subcommand(CliCommand::new("tree").about("Displays tree"))
.subcommand(
CliCommand::new("run")
.about("Run complete pipeline or function by name")
.arg_required_else_help(true)
.subcommand(
CliCommand::new("in_memory")
.about("Runs this pipeline in memory")
.arg(
arg!(
--max_parallelism <max_parallelism> "Max number of threads for parallel execution"
)
.required(false)
.value_parser(value_parser!(String))
.default_value("max")
.default_missing_value("max"),
)
.arg(
arg!(
--params <params> "Trigger params"
)
.required(false)
.value_parser(value_parser!(String))
.default_value("")
.default_missing_value(""),
),
)
.subcommand(
CliCommand::new("function")
.about("Runs function")
.arg(
arg!(
<function_name> "Function name"
)
.required(true),
)
.arg(
arg!(
<in_path> "Input file"
)
.required(true),
)
.arg(
arg!(
<out_path> "Output file"
)
.required(false),
),
)
.subcommand_required(true),
)
.subcommand(
CliCommand::new("upload")
.about("Upload pipeline")
.arg(Arg::new("endpoint"))
.arg_required_else_help(true),
)
.subcommand_required(true)
}