-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: allow common option both before and after
run
- Loading branch information
Showing
8 changed files
with
89 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
"barnard59": minor | ||
--- | ||
|
||
Common CLI flags are now support both when before and after the `run` command. | ||
|
||
For example, these two commands are now equivalent: | ||
|
||
```shell | ||
barnard59 run file.ttl --verbose | ||
barnard59 --verbose run file.ttl | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
"barnard59": major | ||
--- | ||
|
||
Monitoring flags moved before commands: | ||
|
||
- `--enable-buffer-monitor` | ||
- `--otel-debug` | ||
- `--otel-metrics-exporter` | ||
- `--otel-metrics-interval` | ||
- `--otel-traces-exporter` | ||
|
||
Update scripts like | ||
|
||
```diff | ||
-barnard59 run pipeline.ttl --enable-buffer-monitor | ||
+barnard59 --enable-buffer-monitor run pipeline.ttl | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,29 @@ | ||
import program from 'commander' | ||
import runAction from './cli/runAction.js' | ||
import * as otelOptions from './cli/otelOptions.js' | ||
import * as monitoringOptions from './cli/monitoringOptions.js' | ||
import * as commonOptions from './cli/commonOptions.js' | ||
|
||
program | ||
.addOption(commonOptions.variable) | ||
.addOption(commonOptions.variableAll) | ||
.addOption(commonOptions.verbose) | ||
.addOption(commonOptions.enableBufferMonitor) | ||
.addOption(otelOptions.debug) | ||
.addOption(otelOptions.metricsExporter) | ||
.addOption(otelOptions.metricsInterval) | ||
.addOption(otelOptions.tracesExporter) | ||
.addOption(monitoringOptions.enableBufferMonitor) | ||
.addOption(monitoringOptions.debug) | ||
.addOption(monitoringOptions.metricsExporter) | ||
.addOption(monitoringOptions.metricsInterval) | ||
.addOption(monitoringOptions.tracesExporter) | ||
|
||
program | ||
const runCommand = program | ||
.command('run <filename>') | ||
.option('--output [filename]', 'output file', '-') | ||
.option('--pipeline [iri]', 'IRI of the pipeline description') | ||
.action(runAction) | ||
|
||
export default async function () { | ||
runCommand | ||
.addOption(commonOptions.variable) | ||
.addOption(commonOptions.variableAll) | ||
.addOption(commonOptions.verbose) | ||
|
||
await program.parseAsync(process.argv) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters