elves / elvish

Powerful scripting language & versatile interactive shell
https://elv.sh/
BSD 2-Clause "Simplified" License
5.53k stars 297 forks source link

Remove some external command dependencies #1680

Closed krader1961 closed 1 year ago

krader1961 commented 1 year ago

The epm module depends unnecessarily on several external commands; e.g., cat and test. Remove those dependencies. It also has a bug in its -first-upper function due to using the obsolete colon slice index syntax rather than the double period (..) syntax. Replace that function with the str:title builtin.

Related: 1661

krader1961 commented 1 year ago

@zzamboni, Please review this change.

krader1961 commented 1 year ago

Note that there are other possible improvements to the epm module. For example, when PR#1679 (https://github.com/elves/elvish/pull/1679) is merged the sole use of the rm command can be replaced by path:remove. Similarly, I intend to introduce a path:mkdir command which will allow replacing the existing dependency on the external mkdir command with a builtin. Since the epm module has had few changes since it was added there are probably other improvements possible but those are outside the scope of this series of changes.