<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dwarvish.git/src/poem/anthology, 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>Add back spellcheck</title>
<updated>2024-06-15T00:29:32+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-06-15T00:29:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=fedd4c31b0d1c6d036b1105a74b6e6a1f135f2b4'/>
<id>fedd4c31b0d1c6d036b1105a74b6e6a1f135f2b4</id>
<content type='text'>
This commit reworks spellcheck() so it is more verbose about what it
returns. It also re-introduces the use of spellcheck() in
Poem::recite().

Spellcheck now returns a value in the enum, Spelling:
  FullPath -&gt; Indicates a full path was specified as the verb
  OnPath -&gt; Indicates the verb is on the $PATH
  BuiltIn -&gt; Indicates the verb is a built-in command
  None (Option) -&gt; The verb does not exist

This commit also removes some defunct (commented-out) code.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit reworks spellcheck() so it is more verbose about what it
returns. It also re-introduces the use of spellcheck() in
Poem::recite().

Spellcheck now returns a value in the enum, Spelling:
  FullPath -&gt; Indicates a full path was specified as the verb
  OnPath -&gt; Indicates the verb is on the $PATH
  BuiltIn -&gt; Indicates the verb is a built-in command
  None (Option) -&gt; The verb does not exist

This commit also removes some defunct (commented-out) code.
</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>Added the 'which' built-in command</title>
<updated>2024-05-21T05:54:01+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-05-21T05:54:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=dedadcfd30516c40692fe495a6ad10aea7c050de'/>
<id>dedadcfd30516c40692fe495a6ad10aea7c050de</id>
<content type='text'>
Added a built-in which command (for MacOS and BSD), which can check
aliases, and other shell built-in commands, in addition to bins on the
$PATH.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Added a built-in which command (for MacOS and BSD), which can check
aliases, and other shell built-in commands, in addition to bins on the
$PATH.
</pre>
</div>
</content>
</entry>
<entry>
<title>Handle STDERR, in addition to STDOUT</title>
<updated>2024-05-20T00:50:06+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-05-20T00:50:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=4b1b8061e79b42128df4f06fd1e439549bf9696b'/>
<id>4b1b8061e79b42128df4f06fd1e439549bf9696b</id>
<content type='text'>
This patch overhauls the reading and reciting of verses, such that the
redirection of STDERR (in addition to STDOUT, which was already a
feature), is now possible.

Removed the 'stdout' argument from recite(), since it is no longer
needed with how incantations function.

A verse's couplet indicator is now a u8, instead of a bool, with certain
values corresponding to types of couplets, for instance:

  ls | grep Ca | lolcat
  ^    ^         ^
  |    |         2: right side of a couplet
  |    3: both sides of a couplet
  1: left side of a couplet

Incantions are no longer hanlded in rune.rs, and the task macros have
been removed. Now, a verse incants itself, matching on its own meter to
determine how to handle the next verse.

The following runes were added to help with handling STDERR:
  Write2 -&gt; 2&gt;
  WriteAll -&gt; &amp;&gt;
  Addendum2 -&gt; 2&gt;&gt;
  AddendumAll -&gt; &amp;&gt;&gt;

The 'io' field in verse was changed from an Option&lt;Rune&gt;, to an array of
Runes, since a single verse might have multiple IO operations.

The following fields were added to Verse, to assist with handling
STDERR:
  ip -&gt; List of filenames to read into STDIN
  op -&gt; List of filenames to send STDOUT to
  ep -&gt; List of filenames to send STDERR to

Keep track of channels when reading a poem. Channels are relating to IO
operations. If channel is None, words get pushed to the verse's primary
stanza (i.e. the verb or the clause). If a channel is selected, words
are pushed to one of the aforementioned new fields in Verse.
  Read -&gt; ip
  Write/Addedum -&gt; op
  Write2/Addedum2 -&gt; ep
  WriteAll/AddendumAll -&gt; op and ep
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch overhauls the reading and reciting of verses, such that the
redirection of STDERR (in addition to STDOUT, which was already a
feature), is now possible.

Removed the 'stdout' argument from recite(), since it is no longer
needed with how incantations function.

A verse's couplet indicator is now a u8, instead of a bool, with certain
values corresponding to types of couplets, for instance:

  ls | grep Ca | lolcat
  ^    ^         ^
  |    |         2: right side of a couplet
  |    3: both sides of a couplet
  1: left side of a couplet

Incantions are no longer hanlded in rune.rs, and the task macros have
been removed. Now, a verse incants itself, matching on its own meter to
determine how to handle the next verse.

The following runes were added to help with handling STDERR:
  Write2 -&gt; 2&gt;
  WriteAll -&gt; &amp;&gt;
  Addendum2 -&gt; 2&gt;&gt;
  AddendumAll -&gt; &amp;&gt;&gt;

The 'io' field in verse was changed from an Option&lt;Rune&gt;, to an array of
Runes, since a single verse might have multiple IO operations.

The following fields were added to Verse, to assist with handling
STDERR:
  ip -&gt; List of filenames to read into STDIN
  op -&gt; List of filenames to send STDOUT to
  ep -&gt; List of filenames to send STDERR to

Keep track of channels when reading a poem. Channels are relating to IO
operations. If channel is None, words get pushed to the verse's primary
stanza (i.e. the verb or the clause). If a channel is selected, words
are pushed to one of the aforementioned new fields in Verse.
  Read -&gt; ip
  Write/Addedum -&gt; op
  Write2/Addedum2 -&gt; ep
  WriteAll/AddendumAll -&gt; op and ep
</pre>
</div>
</content>
</entry>
<entry>
<title>Sort output of 'export' and 'alias'</title>
<updated>2024-04-12T03:49:51+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-04-12T03:49:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=87e4a3da43e7d203d3405f977ce8e93298dd55c3'/>
<id>87e4a3da43e7d203d3405f977ce8e93298dd55c3</id>
<content type='text'>
Sort the output of the built-in 'export' and 'alias' commands, in cases
where all environment variables/aliases are printed out.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Sort the output of the built-in 'export' and 'alias' commands, in cases
where all environment variables/aliases are printed out.
</pre>
</div>
</content>
</entry>
<entry>
<title>Capture STDOUT as bytes, and convert to string when necessary</title>
<updated>2024-04-07T05:32:30+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-04-07T05:32:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=f5db8d64828db756b80b6022322265a2b4f1c11b'/>
<id>f5db8d64828db756b80b6022322265a2b4f1c11b</id>
<content type='text'>
Previously, the recite() function created the 'out' variable, which was
a String, that got passed to the various incant functions, in order to
capture STDOUT in certain situations. In cases where STDOUT was
captured, it was first converted to a String, and then appended to the
'out' variable, by means of String::from_utf8_lossy(). This works for
basic text, however, does NOT work for binary data. This becomes
problematic, when for example, downling a tar file with curl/wget, that
is then piped ('|') to the tar program. Using from_utf8_lossy() in this
case can corrupt the tar file. This patch makes it so that out is stored
as bytes by default, and only converted to a String when necessary.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, the recite() function created the 'out' variable, which was
a String, that got passed to the various incant functions, in order to
capture STDOUT in certain situations. In cases where STDOUT was
captured, it was first converted to a String, and then appended to the
'out' variable, by means of String::from_utf8_lossy(). This works for
basic text, however, does NOT work for binary data. This becomes
problematic, when for example, downling a tar file with curl/wget, that
is then piped ('|') to the tar program. Using from_utf8_lossy() in this
case can corrupt the tar file. This patch makes it so that out is stored
as bytes by default, and only converted to a String when necessary.
</pre>
</div>
</content>
</entry>
<entry>
<title>Handle aliases in read()</title>
<updated>2024-04-05T04:12:14+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-04-05T04:12:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=1415c8f9b89699000ef8d864ff8f0e1bebca4a5f'/>
<id>1415c8f9b89699000ef8d864ff8f0e1bebca4a5f</id>
<content type='text'>
Instead of handling aliases in the recite() function, which requires two
loops to handle properly with the current implementation, offload
checking for aliases to the read() function.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Instead of handling aliases in the recite() function, which requires two
loops to handle properly with the current implementation, offload
checking for aliases to the read() function.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add better support for aliases</title>
<updated>2024-04-04T06:47:24+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-04-04T06:47:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=9b3e4dd71ec1491e3580e079e9be1b42117a74c9'/>
<id>9b3e4dd71ec1491e3580e079e9be1b42117a74c9</id>
<content type='text'>
Make sure to interpret alias values as their own poems, since aliases
can be fairly complex.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make sure to interpret alias values as their own poems, since aliases
can be fairly complex.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add docstring comments to all the anthology functions</title>
<updated>2024-03-31T06:50:03+00:00</updated>
<author>
<name>Rory Dudley</name>
</author>
<published>2024-03-31T06:50:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.dwarvish.org/dwarvish.git/commit/?id=791b61f97e3ee12dfd765f5e23edd5df527eb803'/>
<id>791b61f97e3ee12dfd765f5e23edd5df527eb803</id>
<content type='text'>
Add docstring comments for all the incant function throughout the
anthology, documenting what each function does, and an example of it's
shell command.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add docstring comments for all the incant function throughout the
anthology, documenting what each function does, and an example of it's
shell command.
</pre>
</div>
</content>
</entry>
</feed>
