alwaysai / alwayscli

A framework for building command-line interfaces in Node.js
Other
6 stars 2 forks source link

Simplify logic using linked lists and recursion #18

Closed carnesen closed 5 years ago

carnesen commented 5 years ago

Previously the command stack was represented as an array and navigated using iteration. This PR tweaks the internal logic to instead represent the command stack as a linked list by adding a next property to the Branch type. This facilitates using recursion to traverse the command stack.