Skip to content

Commit 9f44f28

Browse files
committed
Fix alias links of clog and unalias
1 parent a456a2b commit 9f44f28

File tree

5 files changed

+153
-95
lines changed

5 files changed

+153
-95
lines changed

docs/reference/cli/cmd_alias.md

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,72 @@
1-
## alias
1+
# alias
22

33
Define a new alias of existing commands and arguments.
44

5-
#### Synopsis
5+
## Synopsis
66

7-
```
7+
```bash
88
alias
99
alias <name> [args]
1010
alias -r <name>
1111
```
12-
### Adding a new alias
12+
13+
## Adding a new alias
1314

1415
This command defines new aliases by creating Soar procedures with the given
1516
name. The new procedure can then take an arbitrary number of arguments which are
1617
post-pended to the given definition and then that entire string is executed as a
1718
command. The definition must be a single command, multiple commands are not
1819
allowed. The alias procedure checks to see if the name already exists, and does
1920
not destroy existing procedures or aliases by the same name. Existing aliases
20-
can be removed by using the [unalias](./cmd_unalias.md) command.
21+
can be removed by using the [unalias](./cmd_alias.md#default-alias)
22+
command.
2123

22-
### Removing an existing alias
24+
## Removing an existing alias
2325

24-
To undefine a previously created alias, use the `-r` argument along with the name of the alias to remove.
26+
To undefine a previously created alias, use the `-r` argument along with the
27+
name of the alias to remove.
2528

26-
```alias -r existing-alias```
29+
`alias -r existing-alias`
2730

28-
Note: If you are trying to create an alias for a command that also has a `-r` option, make sure to enclose it in quotes. For example:
31+
Note: If you are trying to create an alias for a command that also has a `-r`
32+
option, make sure to enclose it in quotes. For example:
2933

30-
```alias unalias "alias -r"```
34+
`alias unalias "alias -r"`
3135

32-
### Printing Existing Aliases
36+
## Printing Existing Aliases
3337

34-
With no arguments, alias returns the list of defined aliases. With only the name given, alias returns the current definition.
38+
With no arguments, alias returns the list of defined aliases. With only the name
39+
given, alias returns the current definition.
3540

36-
### Examples
41+
## Examples
3742

3843
The alias `wmes` is defined as:
3944

40-
```
45+
```bash
4146
alias wmes print -i
4247
```
4348

4449
If the user executes a command such as:
4550

46-
```
51+
```bash
4752
wmes {(* ^superstate nil)}
4853
```
4954

5055
... it is as if the user had typed this command:
5156

52-
```
57+
```bash
5358
print -i {(* ^superstate nil)}
5459
```
5560

5661
To check what a specific alias is defined as, you would type
5762

58-
```
63+
```bash
5964
alias wmes
6065
```
61-
### Default Alias Aliases
6266

63-
```
67+
### Default Alias
68+
69+
```bash
6470
a alias
65-
unalias, un alias -r
71+
unalias, un alias -r
6672
```
67-

docs/reference/cli/cmd_clog.md

Whitespace-only changes.

docs/reference/cli/cmd_echo.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,36 @@
1-
## echo
1+
# echo
22

33
Print a string to the current output device.
44

5-
### Synopsis
5+
## Synopsis
66

7-
```
7+
```bash
88
echo [--nonewline] [string]
99
```
1010

11-
### Options
11+
## Options
1212

13-
| **Option** | **Description** |
14-
|:-----------|:----------------|
15-
| `string` | The string to print. |
13+
| **Option** | **Description** |
14+
| :---------------- | :---------------------------------------- |
15+
| `string` | The string to print. |
1616
| `-n, --nonewline` | Supress printing of the newline character |
1717

18-
### Description
18+
## Description
1919

20-
This command echos the args to the current output stream. This is normally stdout but can be set to a variety of channels. If an arg is `--nonewline` then no newline is printed at the end of the printed strings. Otherwise a newline is printed after printing all the given args. Echo is the easiest way to add user comments or identification strings in a log file.
20+
This command echos the args to the current output stream. This is normally
21+
stdout but can be set to a variety of channels. If an arg is `--nonewline` then
22+
no newline is printed at the end of the printed strings. Otherwise a newline is
23+
printed after printing all the given args. Echo is the easiest way to add user
24+
comments or identification strings in a log file.
2125

22-
### Example
26+
## Example
2327

2428
This example will add these comments to the screen and any open log file.
2529

26-
```
30+
```bash
2731
echo This is the first run with disks = 12
2832
```
2933

30-
### See Also
34+
## See Also
3135

32-
[clog](./cmd_clog.md)
36+
[clog](./cmd_output.md#default-aliases)

docs/reference/cli/cmd_output.md

Lines changed: 110 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
## output
1+
# output
22

33
Controls settings related to Soar's output
44

5-
#### Synopsis
5+
## Synopsis
66

7-
```
7+
```bash
88
=======================================================
99
- Output Sub-Commands and Options -
1010
=======================================================
@@ -31,133 +31,182 @@ To view/change a setting: output <setting> [<val
3131

3232
For a detailed explanation of these settings: help output
3333
```
34-
### Summary Screen
34+
35+
## Summary Screen
3536

3637
Using the `output` command without any arguments will display some key output settings:
37-
```
38+
39+
```bash
3840
=======================================================
3941
- Output Status -
4042
=======================================================
41-
Printing enabled Yes
42-
Printing to std::out Yes
43+
Printing enabled Yes
44+
Printing to std::out Yes
4345
-------------------------------------------------------
44-
Agent RHS write output on
46+
Agent RHS write output on
4547
All agent log channels enabled.
4648
-------------------------------------------------------
47-
Warnings on
49+
Warnings on
4850
-------------------------------------------------------
49-
Soar release compilation OFF
50-
Debug printing ON
51+
Soar release compilation OFF
52+
Debug printing ON
5153
-------------------------------------------------------
5254
```
5355

54-
### output command-to-file
56+
## output command-to-file
5557

56-
This command logs a single command. It is almost equivalent to opening a log using [clog](./cmd_clog.md), running the command, then closing the log, the only difference is that input isn't recorded.
58+
This command logs a single command. It is almost equivalent to opening a log
59+
using [clog](./cmd_output.md#default-aliases), running the command, then closing
60+
the log, the only difference is that input isn't recorded.
5761

58-
Running this command while a log is open is an error. There is currently not support for multiple logs in the command line interface, and this would be an instance of multiple logs.
62+
Running this command while a log is open is an error. There is currently not
63+
support for multiple logs in the command line interface, and this would be an
64+
instance of multiple logs.
5965

6066
This command echoes output both to the screen and to a file, just like clog.
6167

62-
#### Options:
63-
| **Option** | **Description** |
64-
|:-----------|:----------------|
65-
| `-a, --append` | Append if file exists. |
68+
### Options
69+
70+
| **Option** | **Description** |
71+
| :------------- | :-------------------------------------------- |
72+
| `-a, --append` | Append if file exists. |
6673
| `filename` | The file to log the results of the command to |
67-
| `command` | The command to log |
68-
| `args` | Arguments for command |
74+
| `command` | The command to log |
75+
| `args` | Arguments for command |
6976

70-
### output log
77+
## output log
7178

72-
The `output log` command allows users to save all user-interface input and output to a file. When Soar is logging to a file, everything typed by the user and everything printed by Soar is written to the file (in addition to the screen).
79+
The `output log` command allows users to save all user-interface input and
80+
output to a file. When Soar is logging to a file, everything typed by the user
81+
and everything printed by Soar is written to the file (in addition to the
82+
screen).
7383

74-
Invoke `output log` with no arguments to query the current logging status. Pass a filename to start logging to that file (relative to the command line interface's home directory). Use the `close` option to stop logging.
84+
Invoke `output log` with no arguments to query the current logging status. Pass
85+
a filename to start logging to that file (relative to the command line
86+
interface's home directory). Use the `close` option to stop logging.
7587

76-
#### Usage
88+
### Usage
7789

78-
```
90+
```bash
7991
output log [-A] filename
8092
output log --add string
8193
output log --close
8294
```
8395

84-
#### Options:
96+
### Options
8597

86-
| **Option** | **Description** |
87-
|:-----------|:----------------|
88-
| `filename` | Open filename and begin logging. |
89-
| `-c, --close` | Stop logging, close the file. |
90-
| `-a, --add string` | Add the given string to the open log file. |
91-
| `-A, --append` | Opens existing log file named `filename` and logging is added at the end of the file. |
98+
| **Option** | **Description** |
99+
| :----------------- | :------------------------------------------------------------------------------------ |
100+
| `filename` | Open filename and begin logging. |
101+
| `-c, --close` | Stop logging, close the file. |
102+
| `-a, --add string` | Add the given string to the open log file. |
103+
| `-A, --append` | Opens existing log file named `filename` and logging is added at the end of the file. |
92104

93-
#### Examples
105+
### Examples
94106

95107
To initiate logging and place the record in foo.log:
96108

97-
```
109+
```bash
98110
output log foo.log
99111
```
100112

101113
To append log data to an existing foo.log file:
102114

103-
```
115+
```bash
104116
output log -A foo.log
105117
```
106118

107119
To terminate logging and close the open log file:
108120

109-
```
121+
```bash
110122
output log -c
111123
```
112124

113-
#### Known Issues with log
125+
### Known Issues with log
114126

115127
Does not log everything when structured output is selected.
116128

117-
### General Output Settings
129+
## General Output Settings
118130

119-
Invoke a sub-command with no arguments to query the current setting. Partial commands are accepted.
131+
Invoke a sub-command with no arguments to query the current setting. Partial
132+
commands are accepted.
120133

121-
| **Option** | **Valid Values** | **Default** |
122-
|:-----------|:-----------------|:------------|
123-
| `echo-commands` | yes or no | off |
124-
| `print-depth` | >= 1 | 1 |
125-
| `verbose` | yes or no | no |
126-
| `warnings` | yes or no | yes |
134+
| **Option** | **Valid Values** | **Default** |
135+
| :-------------- | :--------------- | :---------- |
136+
| `echo-commands` | yes or no | off |
137+
| `print-depth` | >= 1 | 1 |
138+
| `verbose` | yes or no | no |
139+
| `warnings` | yes or no | yes |
127140

128-
#### output agent-logs
141+
## output agent-logs
129142

130-
A Soar agent has 100 log channels available. By default, all are turned on. The `log` RHS-function allows printing as with the `write` function, but limits output to only the specified log channel.
143+
A Soar agent has 100 log channels available. By default, all are turned on. The
144+
`log` RHS-function allows printing as with the `write` function, but limits
145+
output to only the specified log channel.
131146

132-
#### output echo-commands
147+
## output echo-commands
133148

134-
`output echo-commands` will echo typed commands to other connected debuggers. Otherwise, the output is displayed without the initiating command, and this can be confusing.
149+
`output echo-commands` will echo typed commands to other connected debuggers.
150+
Otherwise, the output is displayed without the initiating command, and this can
151+
be confusing.
135152

136-
#### output print-depth
153+
## output print-depth
137154

138-
The `print-depth` command reflects the default depth used when working memory elements are printed (using the [print](./cmd_print.md)). The default value is 1. This default depth can be overridden on any particular call to the [print](./cmd_print.md) command by explicitly using the `--depth` flag, e.g. `print --depth 10 args`.
155+
The `print-depth` command reflects the default depth used when working memory
156+
elements are printed (using the [print](./cmd_print.md)). The default value is
139157

140-
By default, the [print](./cmd_print.md) command prints _objects_ in working memory, not just the individual working memory element. To limit the output to individual working memory elements, the `--internal` flag must also be specified in the [print](./cmd_print.md) command. Thus when the print depth is `0`, by default Soar prints the entire object, which is the same behavior as when the print depth is `1`. But if `--internal` is also specified, then a depth of `0` prints just the individual WME, while a depth of `1` prints all WMEs which share that same identifier. This is true when printing timetags, identifiers or WME patterns.
158+
1. This default depth can be overridden on any particular call to the
159+
[print](./cmd_print.md) command by explicitly using the `--depth` flag, e.g.
160+
`print --depth 10 args`.
141161

142-
When the depth is greater than `1`, the identifier links from the specified WME's will be followed, so that additional substructure is printed. For example, a depth of `2` means that the object specified by the identifier, wme-pattern, or timetag will be printed, along with all other objects whose identifiers appear as values of the first object. This may result in multiple copies of the same object being printed out. If `--internal` is also specified, then individuals WMEs and their timetags will be printed instead of the full objects.
162+
By default, the [print](./cmd_print.md) command prints _objects_ in working
163+
memory, not just the individual working memory element. To limit the output to
164+
individual working memory elements, the `--internal` flag must also be specified
165+
in the [print](./cmd_print.md) command. Thus when the print depth is `0`, by
166+
default Soar prints the entire object, which is the same behavior as when the
167+
print depth is `1`. But if `--internal` is also specified, then a depth of `0`
168+
prints just the individual WME, while a depth of `1` prints all WMEs which share
169+
that same identifier. This is true when printing timetags, identifiers or WME
170+
patterns.
143171

144-
#### output verbose
172+
When the depth is greater than `1`, the identifier links from the specified
173+
WME's will be followed, so that additional substructure is printed. For example,
174+
a depth of `2` means that the object specified by the identifier, wme-pattern,
175+
or timetag will be printed, along with all other objects whose identifiers
176+
appear as values of the first object. This may result in multiple copies of the
177+
same object being printed out. If `--internal` is also specified, then
178+
individuals WMEs and their timetags will be printed instead of the full objects.
145179

146-
The `verbose` command enables tracing of a number of low-level Soar execution details during a run. The details printed by `verbose` are usually only valuable to developers debugging Soar implementation details.
180+
## output verbose
147181

148-
#### output warnings
182+
The `verbose` command enables tracing of a number of low-level Soar execution
183+
details during a run. The details printed by `verbose` are usually only valuable
184+
to developers debugging Soar implementation details.
149185

150-
The `warnings` command enables and disables the printing of warning messages. At startup, warnings are initially enabled. If warnings are disabled using this command, then some warnings may still be printed, since some are considered too important to ignore.
186+
## output warnings
151187

152-
The warnings that are printed apply to the syntax of the productions, to notify the user when they are not in the correct syntax. When a lefthand side error is discovered (such as conditions that are not linked to a common state or impasse object), the production is generally loaded into production memory anyway, although this production may never match or may seriously slow down the matching process. In this case, a warning would be printed only if warnings were `on`. Righthand side errors, such as preferences that are not linked to the state, usually result in the production not being loaded, and a warning regardless of the warnings setting.
188+
The `warnings` command enables and disables the printing of warning messages. At
189+
startup, warnings are initially enabled. If warnings are disabled using this
190+
command, then some warnings may still be printed, since some are considered too
191+
important to ignore.
153192

154-
### Default Aliases
155-
```
193+
The warnings that are printed apply to the syntax of the productions, to notify
194+
the user when they are not in the correct syntax. When a lefthand side error is
195+
discovered (such as conditions that are not linked to a common state or impasse
196+
object), the production is generally loaded into production memory anyway,
197+
although this production may never match or may seriously slow down the matching
198+
process. In this case, a warning would be printed only if warnings were `on`.
199+
Righthand side errors, such as preferences that are not linked to the state,
200+
usually result in the production not being loaded, and a warning regardless of
201+
the warnings setting.
202+
203+
## Default Aliases
204+
205+
```bash
156206
ctf output command-to-file
157207
clog output log
158208
default-wme-depth output print-depth
159209
echo-commands output echo-commands
160210
verbose output verbose
161211
warnings output warnings
162212
```
163-

docs/reference/cli/cmd_unalias.md

Whitespace-only changes.

0 commit comments

Comments
 (0)