<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dwarvish.git/src/compose, branch v0.0.1</title>
<subtitle>a (mostly) posix compliant shell and tiny functional programming language
</subtitle>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/'/>
<entry>
<title>Add/update doc comments</title>
<updated>2024-07-01T02:09:26+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-07-01T02:09:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=b8338719e2cc2138bc67c10ad56fb707f5e3b546'/>
<id>b8338719e2cc2138bc67c10ad56fb707f5e3b546</id>
<content type='text'>
This patch update a ton of the documentation comments throughout the
codebase, refactoring some areas, and adding new comments to others.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch update a ton of the documentation comments throughout the
codebase, refactoring some areas, and adding new comments to others.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix capturing output for internal poems</title>
<updated>2024-06-21T19:40:49+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-06-21T19:40:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=e23e4a036008a6f3a3356d48434615a05dcc17e0'/>
<id>e23e4a036008a6f3a3356d48434615a05dcc17e0</id>
<content type='text'>
Sometime when the switch to the new built-in command system was
happening, we lost the logic to force the capture the output of STDOUT,
mainly used for running internal poems (i.e. 'ls `ls`'). This patch adds
a new field to the Environment struct, called fc (force capture). It
gets set to true before running internal poems, and unset afterwards.
Finally, some checks were added to the incant!() macro to properly
handle STDOUT when fc is set.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Sometime when the switch to the new built-in command system was
happening, we lost the logic to force the capture the output of STDOUT,
mainly used for running internal poems (i.e. 'ls `ls`'). This patch adds
a new field to the Environment struct, called fc (force capture). It
gets set to true before running internal poems, and unset afterwards.
Finally, some checks were added to the incant!() macro to properly
handle STDOUT when fc is set.
</pre>
</div>
</content>
</entry>
<entry>
<title>Updated the way built-in commands are called/used</title>
<updated>2024-06-04T22:25:32+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-06-04T22:25:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=c4cd1e2c165c4f34ebf67fa9350f8732b2aeca13'/>
<id>c4cd1e2c165c4f34ebf67fa9350f8732b2aeca13</id>
<content type='text'>
Previously, built-in commands were fairly primitive, merely outputting
STDOUT and STDERR with the print! macros. However, we need them to
behave like normal programs, that is:

  - Acknowledge their verse's meter (forking, piping, etc.),
  - Ability to capture STDOUT and STDERR (&gt;, 2&gt;),
  - and Affect the currently running environment.

For these reasons, the anthology was reworked, and now contains the
Anthology struct, which mimics both std::process::{Child, Command}.

The AnthologyStdin helper struct was also created, for built-ins to
take input on STDIN, though no built-in is currently using it.

Each built-ins' incant functions were updated to return a
std::process::Output. It contains output from STDOUT, output from
STDERR, and the exit code of the "process".

A fix was also implemented for aliases, where the STDOUT and STDERR
vectors were not being copied to the newly constructed verse.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, built-in commands were fairly primitive, merely outputting
STDOUT and STDERR with the print! macros. However, we need them to
behave like normal programs, that is:

  - Acknowledge their verse's meter (forking, piping, etc.),
  - Ability to capture STDOUT and STDERR (&gt;, 2&gt;),
  - and Affect the currently running environment.

For these reasons, the anthology was reworked, and now contains the
Anthology struct, which mimics both std::process::{Child, Command}.

The AnthologyStdin helper struct was also created, for built-ins to
take input on STDIN, though no built-in is currently using it.

Each built-ins' incant functions were updated to return a
std::process::Output. It contains output from STDOUT, output from
STDERR, and the exit code of the "process".

A fix was also implemented for aliases, where the STDOUT and STDERR
vectors were not being copied to the newly constructed verse.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add doc comments for the Environment struct</title>
<updated>2024-05-20T19:56:13+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-05-20T19:56:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=852e13abbca280b896fd88e722cef7ada11bf3bd'/>
<id>852e13abbca280b896fd88e722cef7ada11bf3bd</id>
<content type='text'>
Added documentation comments for the Environment struct, which includes
uses cases, and defining the fields.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Added documentation comments for the Environment struct, which includes
uses cases, and defining the fields.
</pre>
</div>
</content>
</entry>
<entry>
<title>Allow aliases with the same name as their verb</title>
<updated>2024-05-20T17:27:45+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-05-20T17:27:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=8a7af4aacc0d67a9887ca1fd665b1694fd62a8ca'/>
<id>8a7af4aacc0d67a9887ca1fd665b1694fd62a8ca</id>
<content type='text'>
Previously, when trying to add an alias that used the same name as its
command, an infinite recursion loop would occur, and the program would
panic after the call stack got too deep. For instance, something like:

  alias grep='grep --color=always'

would cause it to panic.

This patch adds a new field to the Environment struct called 'cs' (for
call stack), which can be used to keep track of how many levels deep
into the Poem::read() function we are in. At the moment, it only allows
going two levels deep, but since it's just a u8 value, this could be
increased in the future. The above example now works correctly, but it
does mean that aliases within aliases are not possible, currently.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, when trying to add an alias that used the same name as its
command, an infinite recursion loop would occur, and the program would
panic after the call stack got too deep. For instance, something like:

  alias grep='grep --color=always'

would cause it to panic.

This patch adds a new field to the Environment struct called 'cs' (for
call stack), which can be used to keep track of how many levels deep
into the Poem::read() function we are in. At the moment, it only allows
going two levels deep, but since it's just a u8 value, this could be
increased in the future. The above example now works correctly, but it
does mean that aliases within aliases are not possible, currently.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add the 'alias' built-in command</title>
<updated>2024-03-31T02:15:12+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-03-31T02:15:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=2439f63a1c0859fd454d4a67dc36b61ad6ab5eb8'/>
<id>2439f63a1c0859fd454d4a67dc36b61ad6ab5eb8</id>
<content type='text'>
The shell now has support for aliases (via alias foo=bar). The 'unalias'
command is also available to remove aliases. Finally,
Environment::aliases was changed to be a HashMap&lt;String, String&gt;,
instead of a Vec&lt;String&gt;.

Since the verse's verb might change (for instance, it is an environment
variable, or an alias), add another check in Poem::recite, which simply
continues, instead of running the spellchecker, if the verb is empty.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The shell now has support for aliases (via alias foo=bar). The 'unalias'
command is also available to remove aliases. Finally,
Environment::aliases was changed to be a HashMap&lt;String, String&gt;,
instead of a Vec&lt;String&gt;.

Since the verse's verb might change (for instance, it is an environment
variable, or an alias), add another check in Poem::recite, which simply
continues, instead of running the spellchecker, if the verb is empty.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add wrapper for global shell environment</title>
<updated>2024-03-31T01:05:23+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-03-31T01:05:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=d408624afeb0035217d3d327e21b24a62b803f28'/>
<id>d408624afeb0035217d3d327e21b24a62b803f28</id>
<content type='text'>
Instead of having to pass around a bunch of different data structures
for various shell functions, create the wrapper compose::Environment,
which serves as a global shell state. It is configured via
login/profile/rc scripts initially, but can of course be modified
throughout the lifetime of the shell.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead of having to pass around a bunch of different data structures
for various shell functions, create the wrapper compose::Environment,
which serves as a global shell state. It is configured via
login/profile/rc scripts initially, but can of course be modified
throughout the lifetime of the shell.
</pre>
</div>
</content>
</entry>
</feed>
