Skip to content

Commit 810da9d

Browse files
committed
release
1 parent 5299842 commit 810da9d

File tree

8 files changed

+33
-33
lines changed

8 files changed

+33
-33
lines changed

.buildnumber

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
12
1+
13

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## CHANGELOG
22

3-
### v0.11.0
3+
### v0.11.0 (2024-10-04)
44

55
* Enhancement: Runtime - \[Breaking Change\] Renamed command args to context.
66

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ Commands are structs that must implement the Command trait.<br>
410410
* They should return help documentation in markdown format in order to generate SDK documentation (must for PRs to duckscript official SDK).<br>
411411
* They must implement the **run** function which holds the command logic.<br>
412412
413-
The run function accepts the command arguments (args array contains actual values and not original variables) and returns the command result.<br>
413+
The run function accepts the command invocation context (args array contains actual values and not original variables) and returns the command result.<br>
414414
The command result can be one of the following:
415415
416416
* Continue(Option<String>) - Tells the runner to continue to the next command and optionally set the output variable the given value.
@@ -437,11 +437,11 @@ impl Command for SetCommand {
437437
Box::new((*self).clone())
438438
}
439439
440-
fn run(&self, arguments: CommandArgs) -> CommandResult {
441-
let output = if arguments.args.is_empty() {
440+
fn run(&self, context: CommandInvocationContext) -> CommandResult {
441+
let output = if context.arguments.is_empty() {
442442
None
443443
} else {
444-
Some(arguments.args[0].clone())
444+
Some(context.arguments[0].clone())
445445
};
446446
447447
CommandResult::Continue(output)
@@ -468,11 +468,11 @@ impl Command for GetEnvCommand {
468468
Box::new((*self).clone())
469469
}
470470
471-
fn run(&self, arguments: CommandArgs) -> CommandResult {
472-
if arguments.args.is_empty() {
471+
fn run(&self, context: CommandInvocationContext) -> CommandResult {
472+
if context.arguments.is_empty() {
473473
CommandResult::Error("Missing environment variable name.".to_string())
474474
} else {
475-
match env::var(&arguments.args[0]) {
475+
match env::var(&context.arguments[0]) {
476476
Ok(value) => CommandResult::Continue(Some(value)),
477477
Err(_) => CommandResult::Continue(None),
478478
}
@@ -485,21 +485,21 @@ You can look at more examples in the duckscript_sdk folder.
485485
486486
<a name="sdk-tutorial-commands-context"></a>
487487
## Access The Context
488-
The duckscript runtime context is available in the CommandArgs struc.<br>
488+
The duckscript runtime context is available in the CommandInvocationContext struc.<br>
489489
490490
```rust
491491
/// Run the instruction with access to the runtime context.
492492
///
493-
/// The CommandArgs has the following members:
494-
/// * `args` - The command arguments array
493+
/// The CommandInvocationContext has the following members:
494+
/// * `arguments` - The command arguments array
495495
/// * `state` - Internal state which is only used by commands to store/pull data
496496
/// * `variables` - All script variables
497497
/// * `output_variable` - The output variable name (if defined)
498498
/// * `instructions` - The entire list of instructions which make up the currently running script
499499
/// * `commands` - The currently known commands
500500
/// * `line` - The current instruction line number (global line number after including all scripts into one global script)
501501
/// * `env` - The current runtime env with access to out/err writers, etc...
502-
fn run(&self, arguments: CommandArgs) -> CommandResult;
502+
fn run(&self, context: CommandInvocationContext) -> CommandResult;
503503
```
504504
505505
With access to this context you can add/remove/switch commands in runtime, store/pull internal state, add/remove/change variables and so on...

docs/_includes/content.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ Commands are structs that must implement the Command trait.<br>
365365
* They should return help documentation in markdown format in order to generate SDK documentation (must for PRs to duckscript official SDK).<br>
366366
* They must implement the **run** function which holds the command logic.<br>
367367
368-
The run function accepts the command arguments (args array contains actual values and not original variables) and returns the command result.<br>
368+
The run function accepts the command invocation context (args array contains actual values and not original variables) and returns the command result.<br>
369369
The command result can be one of the following:
370370
371371
* Continue(Option<String>) - Tells the runner to continue to the next command and optionally set the output variable the given value.
@@ -392,11 +392,11 @@ impl Command for SetCommand {
392392
Box::new((*self).clone())
393393
}
394394
395-
fn run(&self, arguments: CommandArgs) -> CommandResult {
396-
let output = if arguments.args.is_empty() {
395+
fn run(&self, context: CommandInvocationContext) -> CommandResult {
396+
let output = if context.arguments.is_empty() {
397397
None
398398
} else {
399-
Some(arguments.args[0].clone())
399+
Some(context.arguments[0].clone())
400400
};
401401
402402
CommandResult::Continue(output)
@@ -423,11 +423,11 @@ impl Command for GetEnvCommand {
423423
Box::new((*self).clone())
424424
}
425425
426-
fn run(&self, arguments: CommandArgs) -> CommandResult {
427-
if arguments.args.is_empty() {
426+
fn run(&self, context: CommandInvocationContext) -> CommandResult {
427+
if context.arguments.is_empty() {
428428
CommandResult::Error("Missing environment variable name.".to_string())
429429
} else {
430-
match env::var(&arguments.args[0]) {
430+
match env::var(&context.arguments[0]) {
431431
Ok(value) => CommandResult::Continue(Some(value)),
432432
Err(_) => CommandResult::Continue(None),
433433
}
@@ -440,21 +440,21 @@ You can look at more examples in the duckscript_sdk folder.
440440
441441
<a name="sdk-tutorial-commands-context"></a>
442442
## Access The Context
443-
The duckscript runtime context is available in the CommandArgs struc.<br>
443+
The duckscript runtime context is available in the CommandInvocationContext struc.<br>
444444
445445
```rust
446446
/// Run the instruction with access to the runtime context.
447447
///
448-
/// The CommandArgs has the following members:
449-
/// * `args` - The command arguments array
448+
/// The CommandInvocationContext has the following members:
449+
/// * `arguments` - The command arguments array
450450
/// * `state` - Internal state which is only used by commands to store/pull data
451451
/// * `variables` - All script variables
452452
/// * `output_variable` - The output variable name (if defined)
453453
/// * `instructions` - The entire list of instructions which make up the currently running script
454454
/// * `commands` - The currently known commands
455455
/// * `line` - The current instruction line number (global line number after including all scripts into one global script)
456456
/// * `env` - The current runtime env with access to out/err writers, etc...
457-
fn run(&self, arguments: CommandArgs) -> CommandResult;
457+
fn run(&self, context: CommandInvocationContext) -> CommandResult;
458458
```
459459
460460
With access to this context you can add/remove/switch commands in runtime, store/pull internal state, add/remove/change variables and so on...

duckscript/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "duckscript"
3-
version = "0.9.0"
3+
version = "0.10.0"
44
authors = ["Sagie Gur-Ari <sagiegurari@gmail.com>"]
55
description = "Simple, extendable and embeddable scripting language."
66
license = "Apache-2.0"

duckscript_cli/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "duckscript_cli"
3-
version = "0.10.0"
3+
version = "0.11.0"
44
authors = ["Sagie Gur-Ari <sagiegurari@gmail.com>"]
55
description = "The duckscript command line executable."
66
license = "Apache-2.0"
@@ -27,8 +27,8 @@ name = "duck"
2727
path = "src/main.rs"
2828

2929
[dependencies]
30-
duckscript = { version = "^0.9.0", path = "../duckscript" }
31-
duckscriptsdk = { version = "^0.10.0", path = "../duckscript_sdk", default-features = false }
30+
duckscript = { version = "^0.10.0", path = "../duckscript" }
31+
duckscriptsdk = { version = "^0.11.0", path = "../duckscript_sdk", default-features = false }
3232

3333
[features]
3434
tls-rustls = ["duckscriptsdk/tls-rustls"]

duckscript_sdk/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "duckscriptsdk"
3-
version = "0.10.0"
3+
version = "0.11.0"
44
authors = ["Sagie Gur-Ari <sagiegurari@gmail.com>"]
55
description = "The duckscript SDK."
66
license = "Apache-2.0"
@@ -29,7 +29,7 @@ attohttpc = { version = "^0.28", default-features = false, features = [
2929
base64 = "^0.22"
3030
cfg-if = "^1"
3131
colored = "^2"
32-
duckscript = { version = "^0.9.0", path = "../duckscript" }
32+
duckscript = { version = "^0.10.0", path = "../duckscript" }
3333
evalexpr = "^11"
3434
fs_extra = "^1"
3535
fsio = { version = "^0.4", features = ["temp-path"] }

0 commit comments

Comments
 (0)