Skip to content

Add shell functions for skipping part of a tutorial/demo #7

@veracioux

Description

@veracioux

When I create tuterm scripts, I often want to test out a certain portion of the tutorial starting somewhere from the middle. What I can do is comment out the part of the code that I want to skip. But this is annoying, and it comes with a problem:

What if those previous commands create or modify files that are necessary for the rest of the tutorial/demo to run correctly?

I propose the following solution: add SKIP and UNSKIP shell functions. SKIP sets a kind of state flag that indicates that all the commands that follow should be skipped. UNSKIP should do the opposite: unset the flag so that the commands that follow are not skipped.

cmdline ...           # Runs normally
SKIP
message "open a file" # Skipped
cmdline xdg-open file # Skipped
UNSKIP
cmdline ...           # Runs normally

What do skipped commands do?
Regardless of the mode the user specified, they should behave as if tuterm were started with the --mode demo --fast options, along with any other arguments that may have been given by the user.

‼️ Make sure to document the new features in the man page. ‼️

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions