-
Notifications
You must be signed in to change notification settings - Fork 782
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
feat: Print help menu on --help
for all commands
#1456
Conversation
9ba21db
to
e9cab2e
Compare
e9cab2e
to
cd05e7c
Compare
cd05e7c
to
52d4a93
Compare
I have been thinking about making a change like this for some time, so have some thoughts to share, but won't have the time to go through this issue thoroughly and share my thoughts for a few days. |
@jthegedus Wondering if you are available to take a look at this now? (P.S. thank you for merging the other PRs) |
Closing this to reduce my personal PR queue as this repository seems to not be maintained |
Hi @hyperupcall , sorry for the extremely late reply here (this PR has literal sat in an open tab of mine since you opened it). I've been in the working rewriting asdf in Golang (in a private org fork). I think this is a good improvement, but it doesn't make sense to get this merged given that everything is changing with the Go implementation. Happy to accept a PR if the Go implementation needs a similar improvement! |
@Stratus3D Yeah I figured you were focusing your effort on the Go (previously Rust?) fork. That's why I closed all my other PRs too; But the rewrite is a bit perplexing to me as there are existing solutions such as Mise and other solutions that are by now, much more mature. In any case, once the Go implementation is public, I'll try it out and see if there is anything I can contribute; |
Summary
Uses a function
has_help_flag
to determine if should print the help menu. If it should, it prints all valid uses (fromhelp.txt
), and returns success.These changes also change some invocations of
printf
todisplay_error
(of some help text), since in other places it was used and it is more correct. These changes are only in places where no argument were passed, and the help menu is printed while exiting with code1
.Fixes: #1330
Other Information
I saw that the
asdf shell
help commands were different.In
help.txt
:In
command-export-shell-version.bash
:I assume one of them should be updated?
More generally, I think there is an issue that the help menu and its shorthands with
--help
can be out of sync. Should I do some restructuring so that instead ofcat
ing thehelp.txt
file, it uses a shared variables approach? (see the hack I do for so alignment works for both the source and the output):Another approach is something I've done, where various functions with multiple
printf
s are called in sequence, but that is more for a help menu that looks completely differentdifferent help menu
Or, we can just leave the changes as they are - thoughts?