Skip to content

Commit

Permalink
improve doc jason-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
jomifred committed Oct 7, 2024
1 parent a8d1e31 commit 1e20c56
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
16 changes: 12 additions & 4 deletions doc/jason-cli/commands.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,15 @@ starts a new (empty) MAS
[<mas name>] MAS unique identification
--console output will be sent to the console instead of a GUI
--no-net disable all net services (mind inspector, runtime
services, Mbeans, ...
services, Mbeans, ...)
--mas2j=<file> runs jason project without
gradle (offline), java classes should be compiled
before running.
--cp=<classpath> directories where java classes can be found (for
before running
--use-gradle executes the MAS defined in a mas2j file using gradle
--cp=<classpath> directories where java classes can be found (for
environment implementation, for instance)

--env=<env class> class that implements the environment and its
arguments
```

Regarding `.mas2j` files, they can be executed in two ways:
Expand Down Expand Up @@ -118,6 +120,12 @@ The source code can be informed at the end of the command enclosed by `{` and `
jason agent start bob { +!g <- .print(ok). }
```

Depending on your prompt shell, you should enclose the commands by "":

```
jason agent start bob " { +!g <- .print(ok). } "
```

### Other agent commands

Type `jason agent stop --help` for details of `stop` command ...
Expand Down
10 changes: 10 additions & 0 deletions jason-cli/src/main/java/jason/cli/mas/ListMAS.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package jason.cli.mas;

import jason.infra.local.RunLocalMAS;
import picocli.CommandLine;
import picocli.CommandLine.Command;

Expand All @@ -13,8 +14,17 @@ public class ListMAS implements Runnable {
@CommandLine.ParentCommand
protected MAS parent;

@CommandLine.Option(names = { "--clean" }, defaultValue = "false", description = "remove all refs to existing running MAS")
boolean clean;

@Override
public void run() {
if (clean) {
var f = RunLocalMAS.getRunningMASFile();
parent.parent.println("deleting "+f);
f.delete();
return;
}
var all = RunningMASs.getAllRunningMAS();
//parent.parent.println("running MAS:");
for (var mas: all.keySet()) {
Expand Down
2 changes: 1 addition & 1 deletion jason-cli/src/main/java/jason/cli/mas/StartMAS.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class StartMAS implements Runnable {
@Option(names = { "--console" }, defaultValue = "false", description = "output will be sent to the console instead of a GUI")
boolean console;

@Option(names = { "--no-net" }, defaultValue = "false", description = "disable all net services (mind inspector, runtime services, Mbeans, ...")
@Option(names = { "--no-net" }, defaultValue = "false", description = "disable all net services (mind inspector, runtime services, Mbeans, ...)")
boolean noNet;

@Option(names = { "--env" }, defaultValue = "", paramLabel = "<env class>", description = "class that implements the environment and its arguments")
Expand Down

0 comments on commit 1e20c56

Please sign in to comment.