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
Copy file name to clipboardExpand all lines: RELEASE.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,10 @@ The macOS version is a universal binary, codesigned and notarized.
4
4
5
5
Changes:
6
6
7
+
0.3.0:
8
+
- Slightly change behaviour of `--output-folder`: now, if the input files are within the CWD, the output files will be put into the output folder with the same structure of subfolders.
9
+
- Add `script` command to run a series of subcommands.
10
+
7
11
0.2.0:
8
12
- Rename subcommand `remove-silence` to `trim-silence`
9
13
- Change `norm` subcommand to take a `--mode` argument; one of `peak` or `rms` rather than `--rms` flag. Default mode is `peak`.
@@ -302,6 +303,58 @@ int SignetInterface::Main(const int argc, const char *const argv[]) {
302
303
}
303
304
}
304
305
306
+
{
307
+
auto script = app.add_subcommand(
308
+
"script",
309
+
"Run a script file containing a list of commands to run. The script file should be a text file with one command per line. The commands should be in the same format as you would use on the command line. Empty lines or lines starting with # are ignored.");
310
+
script->add_option("script-file", m_script_filepath, "The filepath for the script file.")
311
+
->check(CLI::ExistingPath);
312
+
script->final_callback([&]() {
313
+
auto file_data = ReadEntireFile(m_script_filepath);
314
+
if (file_data.empty()) {
315
+
throwCLI::ParseError("script file not accessible or empty", 1);
316
+
}
317
+
318
+
Replace(file_data, "\r\n", "\n");
319
+
Replace(file_data, "\r", "\n");
320
+
auto lines = Split(file_data, "\n", false);
321
+
322
+
for (auto line : lines) {
323
+
while (line.size() && std::isspace(line.front()))
324
+
line.remove_prefix(1);
325
+
while (line.size() && std::isspace(line.back()))
326
+
line.remove_suffix(1);
327
+
328
+
if (line.empty()) continue;
329
+
if (line[0] == '#') continue;
330
+
331
+
std::string_view command_name {};
332
+
{
333
+
size_t pos = 0;
334
+
while (pos < line.size() && !std::isspace(line[pos])) {
335
+
++pos;
336
+
}
337
+
command_name = line.substr(0, pos);
338
+
}
339
+
340
+
bool found = false;
341
+
for (auto subcommand : app.get_subcommands({})) {
342
+
if (subcommand == script) continue;
343
+
if (subcommand->get_name() != command_name) continue;
@@ -806,6 +807,17 @@ Creates a Github flavour markdown file containing the full CLI - based on runnin
806
807
`output-file TEXT REQUIRED`
807
808
The filepath for the generated markdown file.
808
809
810
+
## :sound: script
811
+
### Description:
812
+
Run a script file containing a list of commands to run. The script file should be a text file with one command per line. The commands should be in the same format as you would use on the command line. Empty lines or lines starting with # are ignored.
813
+
814
+
### Usage:
815
+
`script``[script-file]`
816
+
817
+
### POSITIONALS:
818
+
`script-file TEXT:PATH(existing)`
819
+
The filepath for the script file.
820
+
809
821
## :sound: undo
810
822
### Description:
811
823
Undo any changes made by the last run of Signet; files that were overwritten are restored, new files that were created are destroyed, and files that were renamed are un-renamed. You can only undo once - you cannot keep going back in history.
0 commit comments