You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// use tmc_langs_util::task_executor::RefreshData;
15
15
@@ -59,29 +59,41 @@ pub enum Command {
59
59
exercise_path:PathBuf,
60
60
},
61
61
62
-
/// Compresses the target exercise into a ZIP. Only includes student files using the student file policy of the exercise's plugin
62
+
/// Compresses the target exercise. Only includes student files using the student file policy of the exercise's plugin
63
63
#[clap(long_about = SCHEMA_NULL)]
64
64
CompressProject{
65
65
/// Path to the directory where the exercise resides.
66
66
#[clap(long)]
67
67
exercise_path:PathBuf,
68
-
/// Path to the output ZIP archive. Overwritten if it already exists.
68
+
/// Path to the output archive. Overwritten if it already exists.
69
69
#[clap(long)]
70
70
output_path:PathBuf,
71
+
/// Compression algorithm to use.
72
+
#[clap(long, default_value_t = Compression::Zip)]
73
+
compression:Compression,
74
+
/// If set, simply compresses the target directory with all of its files.
75
+
#[clap(long)]
76
+
naive:bool,
71
77
},
72
78
73
79
#[clap(subcommand)]
74
80
Core(Core),
75
81
76
-
/// Extracts an exercise from a ZIP archive. If the output-path is a project root, the plugin's student file policy will be used to avoid overwriting student files
82
+
/// Extracts an exercise from an archive. If the output-path is a project root, the plugin's student file policy will be used to avoid overwriting student files
77
83
#[clap(long_about = SCHEMA_NULL)]
78
84
ExtractProject{
79
-
/// Path to the ZIP archive.
85
+
/// Path to the archive.
80
86
#[clap(long)]
81
87
archive_path:PathBuf,
82
88
/// Path to the directory where the archive will be extracted.
83
89
#[clap(long)]
84
90
output_path:PathBuf,
91
+
/// Compression algorithm used for the archive.
92
+
#[clap(long, default_value_t = Compression::Zip)]
93
+
compression:Compression,
94
+
/// If set, simply extracts the target directory with all of its files.
95
+
#[clap(long)]
96
+
naive:bool,
85
97
},
86
98
87
99
/// Parses @Points notations from an exercise's exercise files and returns the point names found
@@ -144,29 +156,36 @@ pub enum Command {
144
156
output_path:PathBuf,
145
157
},
146
158
147
-
/// Takes a submission ZIP archive and turns it into an archive with reset test files, and tmc-params, ready for further processing
159
+
/// Takes a submission archive and turns it into an archive with reset test files, and tmc-params, ready for further processing
148
160
#[clap(long_about = SCHEMA_NULL)]
149
161
PrepareSubmission{
150
162
/// The output format of the submission archive. Defaults to tar.
151
-
#[clap(long,default_value = "tar")]
152
-
output_format:OutputFormatWrapper,
163
+
#[clap(long,default_value_t = Compression::Tar)]
164
+
output_format:Compression,
153
165
/// Path to exercise's clone path, where the unmodified test files will be copied from.
154
166
#[clap(long)]
155
167
clone_path:PathBuf,
156
168
/// Path to the resulting archive. Overwritten if it already exists.
157
169
#[clap(long)]
158
170
output_path:PathBuf,
159
-
/// If given, the tests will be copied from this stub ZIP instead, effectively ignoring hidden tests.
160
-
#[clap(long)]
161
-
stub_zip_path:Option<PathBuf>,
162
-
/// Path to the submission ZIP archive.
171
+
/// If given, the tests will be copied from this stub instead, effectively ignoring hidden tests.
172
+
// alias for backwards compatibility
173
+
#[clap(long, alias = "stub_zip_path")]
174
+
stub_archive_path:Option<PathBuf>,
175
+
/// Compression algorithm used for the stub archive.
176
+
#[clap(long, default_value_t = Compression::Zip)]
177
+
stub_compression:Compression,
178
+
/// Path to the submission archive.
163
179
#[clap(long)]
164
180
submission_path:PathBuf,
181
+
/// Compression algorithm used for the submission.
182
+
#[clap(long, default_value_t = Compression::Zip)]
183
+
submission_compression:Compression,
165
184
/// A key-value pair in the form key=value to be written into .tmcparams. If multiple pairs with the same key are given, the values are collected into an array.
166
185
#[clap(long)]
167
186
tmc_param:Vec<String>,
168
-
#[clap(long)]
169
187
/// If given, the contents in the resulting archive will be nested inside a directory with this name.
188
+
#[clap(long)]
170
189
top_level_dir_name:Option<String>,
171
190
},
172
191
@@ -549,22 +568,6 @@ impl FromStr for Locale {
549
568
}
550
569
}
551
570
552
-
pubstructOutputFormatWrapper(pubOutputFormat);
553
-
554
-
implFromStrforOutputFormatWrapper{
555
-
typeErr = anyhow::Error;
556
-
557
-
fnfrom_str(s:&str) -> Result<Self,Self::Err>{
558
-
let format = match s {
559
-
"tar" => OutputFormat::Tar,
560
-
"zip" => OutputFormat::Zip,
561
-
"zstd" => OutputFormat::TarZstd,
562
-
_ => anyhow::bail!("invalid format"),
563
-
};
564
-
Ok(OutputFormatWrapper(format))
565
-
}
566
-
}
567
-
568
571
// == utilities for printing the JSON schema of the objects printed to stdout by the CLI ==
569
572
constSCHEMA_NULL:&str = "Result data JSON format: null";
570
573
constSCHEMA_TOKEN:&str = r#"Result data JSON format:
0 commit comments