Status

Working on a beautiful update

Dec 24, 2022

Merry christmas eve! I have updated Scrawl to support extensions and Lexer to properly parse bash files. I have implemented an extension at code/scrawl/HelpMenuGenerator. I updated .config/scrawl.json to load the HelpMenuGenerator as an extension. Running scrawl runs the help menu generation, but there are still some bugs & it produces files that shouldn't be produced & ... it just needs to be worked on. All the code of concern is in HelpMenuGenerator::scan_filelist_processed. That method is a mess and probably should be refactored before being fixed. Or maybe I should just start kind of from scratch. Idunner.

I have the Tlf\Bash\Scrawl\Lexer (code/scrawl/Lexer.php) enabled, but it's not updated or doing anything yet. I think that one is supposed to generate api documentation files, just listing all the functions across all the files. I need help menus more, but I would like to update that as well.

UPDATE 2 Help menu generation is functional, though it may be sad, feature wise... idk. it works! This library is trash. Like I like the functionality, but the stuff in code/core/core.bash is just ... it's just not very good, idk. whatever.

UPDATE 3 help_groups.bash is being generated but ... idk it's just not quite right. All the help menu stuff is kind of confusing and complex & I think this lib needs some internal code rewrites to fix the complications.

Next

  • Officially release after updating my Lexer and Code Scrawl & generating documentation & help menus
  • Auto-copy a default scrawl.json file, maybe? Or maybe let scrawl do that

High Priority todo

  • Remove command group from the sub-help menus. (Ex: bent log help could show [default] for bent log instead of [log])
  • None at this time

Low Priority todo

These features are low priority because Git Bent does almost everything I need it to do. Most of this is quality-of-life, and I have other priorities than perfecting this library.

  • Clearly document aliases
  • Document how help works & how its different from other groups
  • Feature-complete sample scripts
  • Allow multiple library sources to be given, so extensions can be added to an existing library.
  • Via CodeScrawl, Write a consolidated file to list ALL internal functions & another for ALL bent functions
  • Add a @hide verb to hide items from the help menu (like the alias callback?)
  • Add shorthand & alias support to the docblock based help-menu generator
  • write prompt_consume feature. (see headers below)
  • Write config feature
    • For yes-no prompts, "always" will prevent that future prompt.
    • Configure different git users to switch between

Latest (newest to oldest)

  • help menu improvements
  • Fix the bug that caused sub run commands to fail
  • Write install instructions that are copy+pasted into libraries when new libraries are setup
  • Wrote decent group.bash scripts
  • Reviewed development tools install instructions (in README.src.md) & got everything inline.
  • Polished core_setup and the run script it copies over
  • Cleanup Status.md
  • Cleanup Readme
  • fix bug with run help help
  • move in help script
  • Various things ....
  • Create new repo and separate library code from Git Bent

Sample Scripts

  • Write good sample scripts that actually do SOMETHING. Doing all of this is overkill. I like it. I want it. I don't personally need it. This would be for other people to have an easier on-boarding experience. But that's not my responsibility right now. I have other priorities than perfecting this library. It just needs to be NICE. Maybe someone else can contribute the rest of this stuff.
    • It doesn't have to be anything incredibly useful, but it ... Idk... maybe some convenience git functions or something that actually demonstrates how heplpful this library can be.
    • In group.bash files Feature import statements
      • For including other scripts of the group
      • For including helper functions only used by this particular group
    • In group.bash Feature some of the major features & internal methods:
      • group_alias(){} function
      • run group command to call another method
      • prompt (and variants)
      • msg (and variants)
      • multi-chooser & multi-file-chooser
      • Colors
      • steps
      • Strings (just 2 or 3 of the convenience functions)
    • In library files
      • A couple simple wrapper functions that are used by one of the group.bash examples
    • In help files
      • 1 auto-generated help menu
      • 1 hand-crafted help menu (with all the header features & whatnot)

Docblock alias example

# @tip Switch between versions of your project
# @shorthand b, v, version
# @alias core switch, checkout
function switch_branch(){}
  • shorthand means "Using the same command group"
  • alias means "This other group+command combo also executes this function"
    • bent checkout & bent core switch would both do the same as bent switch b/bent switch version

prompt_consume

  • Consumes variables that are passed from cli
  • run needs to consume some vars
  • is called from within prompt functions to shortcircuit prompting
  • the calling code doesn't change
  • global prompt_answers array?

Recent Notes (before I saw these prompt_consume bits down here)

Idr what this would do. Something like ... if somebody does [bent save y y y], then prompt_consume would take the first y as an answer. The 2nd prompt_consume would use the 2nd y. Allows scriptable stuff. Buttt this is probably better done with named things like [bent save --push y --diffs no --etc etc]. This, however, does not work with my current model for how ... everything works. I don't have help menu consideration for these options. Good thing this is a low priority feature.

prompt_consume Example

  1. There are files with merge conflicts.
  2. bent save y "unimportant changes"
    • currently, prompt "there are merge conflicts. continue?" then prompt "what's changed?"
  3. run does prompt_consume 1 to 'eat' the save command
  4. The 1st prompt will prompt_consume 1 answer && if [[ $answer == "" ]];then do the actual prompt
    • y is automatically given as the answer though
  5. The 2nd prompt (for commit message) will prompt_consume 1 answer as well
    • "unimportant changes" is automatically given