-
Notifications
You must be signed in to change notification settings - Fork 19
Adds new version of help50
#210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dmalan
wants to merge
83
commits into
main
Choose a base branch
from
help50
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Merges main into help50 branch
Member
Author
|
Thank you! Addressed all of these and working on a few more tweaks before merging! |
JadeIshida
approved these changes
Jul 6, 2024
|
cool |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To be squashed when merging.
This new version is implemented in Bash (instead of Python) as follows, wherein usage is inspired by
systemctl, even though it doesn't run as a daemon but, rather, per login shell. It runs locally and automatically now, without any server.help50 startsets$HELP50to$$, the PID of the shell in which the command was run and launchesscript, which logs standard I/O to/tmp/help50.$$.typescript.help50 stopsendsSIGHUPto the PID ofscript.help50 statuschecks for$HELP50, which is set only whenhelp50is started for a shell.help50 disablewrites/tmp/help50.lock.help50 enabledeletes/tmp/help50.lock.help50 is-enabledchecks for/tmp/help50.lock./etc/profile.d/help50.shis a config that that's only sourced when$HELP50is set.$PROMPT_COMMANDto_help50, which is a Bash function implemented therein that, if the most recent command exited with non-0 status (per$?), checks for/tmp/help50.$HELP50.typescript, passes it as standard input to each executable in/opt/cs50/lib/help50/(implemented in any language)._helpfulfunction that, by default, displays it in yellow to help the user._helplessinstead, which doesn't do anything incs50/clibut can be overridden incs50/codespaceto relay it to ddb50._helpedis called, which doesn't do anything incs50/clibut can be overridden incs50/codespaceto indicate to the user that help is (no longer) available./etc/profile.d/cli.shstartshelp50automatically./opt/cs50/lib/clicontains several helper functions (written in Bash) that our own wrappers andhelp50use.