Thursday, November 1, 2018

Simulating Power Shell

Getting my join to work as a Power Shell module requires me to 1) Upgrade, 2) Become more expert at Power Shell.

It is simpler for me to create a mickey mouse Power Shell-like macro function.  Then create more  expressive command functions for Match and Cursor in join. I know this is temporary, so I make it extremely simple that I can toss it at the right time.

The most likely outcome is that one of the tech companies or a start up runs with this idea, leaving me in the dust. The other possibility is that one of the companies makes a better Power Shell.

Example:

User may have four of five cursors engaged in a simple plain text file.   The user needs to group those cursor, and needs to change the match function, possibly on a Cursos bais. The user wants to create a batch file of the most interesting web pages so join can work through them And the shell needs a generic pipe function to express the concatenation of one join to another.

I can 'fake' a lot of this,write simplified version and have a jury rigged assignment function to simulate the variable assignment function in Power Shell.  Then I can move on with a competitive proof of concept the pros can integrate it into a shell.  Meanwhile, the package comes with enough shell to test all modes in a standalone environment without all the shell set up.

An argument parser is simpel,. so things like:

Create-Cursor arg1,arg2,... would create series of cursors attached to a particular attachment.
I can use
$result = Create-Cursor arg1,arg2,..

As long as I retain the same argument format, I can follow with:

Delete-Cursor $result  // Using the standard '$' for variable

This is how PowerShell works, it is easily duplicated in the special case for a single application.   Then the pros duplicate the idea, making it very integrated in PowerShell, keeping the join  concept.

So I did it

About 60 lines of code yields software that maintains macro expansions using '$' with the switch '-' character detected.  I Ijust did a crude implementation of the $ function inside a parse arguments routine, with absolutely no error checking and a strict syntax.

  But it is enough to simulate PowerShell; or any other shell dong macros. So I can that proceed to build cmdlets as needed to manage Cursors and Match functions while testing.  My code writing time was a couple of hours, but my system upgrade, set up, and learn process on Power Shell would have been two days, with uncertain results.

The power of c, do something with for proof of concept very quickly. And, as a bonus, we get a crappy little shell system usable until the market catches up with more powerful shells  Copy cat, the industry needs copy cats because it leads to a common standard for data.

No comments: