-
Notifications
You must be signed in to change notification settings - Fork 19
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
Adds new version of help50
#210
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 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
Thank you! Addressed all of these and working on a few more tweaks before merging! |
JadeIshida
approved these changes
Jul 6, 2024
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 start
sets$HELP50
to$$
, the PID of the shell in which the command was run and launchesscript
, which logs standard I/O to/tmp/help50.$$.typescript
.help50 stop
sendsSIGHUP
to the PID ofscript
.help50 status
checks for$HELP50
, which is set only whenhelp50
is started for a shell.help50 disable
writes/tmp/help50.lock
.help50 enable
deletes/tmp/help50.lock
.help50 is-enabled
checks for/tmp/help50.lock
./etc/profile.d/help50.sh
is a config that that's only sourced when$HELP50
is set.$PROMPT_COMMAND
to_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)._helpful
function that, by default, displays it in yellow to help the user._helpless
instead, which doesn't do anything incs50/cli
but can be overridden incs50/codespace
to relay it to ddb50._helped
is called, which doesn't do anything incs50/cli
but can be overridden incs50/codespace
to indicate to the user that help is (no longer) available./etc/profile.d/cli.sh
startshelp50
automatically./opt/cs50/lib/cli
contains several helper functions (written in Bash) that our own wrappers andhelp50
use.