GetPoplog / Seed

Scripts for getting Poplog onto your Linux machine
MIT License
7 stars 3 forks source link

poplog findhelp --category=help --exact <topic>, closing #130 #131

Closed sfkleach closed 1 year ago

sfkleach commented 1 year ago

This change makes it possible to extend the poplog-command tool using autoloadable Pop-11 files, provides a subcommand extension that can interrogate the file-based documentation using the internal library functions, and to list the results as JSON. See #130.

There are several parts to this PR:

Notes

  1. The pop-11 support code includes an implementation of named-records, which I have called "dict"s in deliberate imitation of Python's dicts. I regard this implementation as the first version of an important missing feature. It also includes implementations of discinline and incharline that are imports from the GOSPL library. Over time I want to integrate all of GOSPL into GetPoplog.
  2. All the extensions that are specific to the GetPoplog distribution are placed in the getpoploglib/ folder. This folder is only linked into Poplog's search path if a programmer includes uses getpoplog in their project.
  3. The poplog command tool is a C-program that is generated at build-time. At the moment it is effectively a template that is implemented as a Bash script. Fortunately this change was uncomplicated. As the script gets more complicated we should probably move the generation to another tool. Python is the GetPoplog scripting tool of choice.
sfkleach commented 1 year ago

Firstly, I note that poplog findhelp is not documented in the --help option. It plainly needs to be documented but I rather feel the best place would be under $usepop/pop/getpoploglib/help/getpoplog_subcommand_findhelp. However the VSC work depends on this, so this fix will come later. UPDATE: See issue #138.

sfkleach commented 1 year ago

Secondly, I am concerned that not all the variables of the dict library will autoload e.g. isdict. That's a mistake and needs rectifying. However, it too can wait for a follow-up, since this work is on the critical path. UPDATE: See issue #137.

sfkleach commented 1 year ago

Thirdly, the documentation for json_print, json_println and json_pprint is missing. This will be backfilled. UPDATE: See is #136.

sfkleach commented 1 year ago

What about working with other Poplog distributions? It would make sense if, as a fallback, we either (1) provide a webservice that performs this search or (2) compile a static database that can be downloaded, e.g. SQLITE, along with a procedure for searching it. Both solutions suffer from the serious flaw that they cannot include locally installed packages. However, a webservice would be quite easy to provide (although file-paths would need to be replaced by URLs).

willprice commented 1 year ago

Ah, execvp doesn't return if the command runs successfully, I thought you were referring to perror when you were saying this earlier. Got it, lgtm :)