Skip to content
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

Batman unalias #122

Merged
merged 1 commit into from
Aug 24, 2024
Merged

Batman unalias #122

merged 1 commit into from
Aug 24, 2024

Conversation

it-is-wednesday
Copy link
Contributor

@it-is-wednesday it-is-wednesday commented Jul 14, 2024

Hi:) I noticed that some manual entries, specifically kubectl-related, have this weird comma in their name which indicates synonyms I suppose? See the output of man -k . | grep kubectl on MacOS installed via Homebrew:

kubectl-alpha(1), kubectl alpha(1) - Commands for features in alpha
kubectl-annotate(1), kubectl annotate(1) - Update the annotations on a resource
kubectl-api-resources(1), kubectl api-resources(1) - Print the supported API resources on the server
kubectl-api-versions(1), kubectl api-versions(1) - Print the supported API versions on the server, in the form of "group/version"
kubectl-apply(1), kubectl apply(1) - Apply a configuration to a resource by file name or stdin
...

These synonyms caused batman to fail:

$ src/batman.sh
<select here kubectl-events...>
No manual entry for kubectl-events(1), kubectl events

This patch ignores everything after the first comma, taking only the "main" name.
Thanks for the project:)

Copy link
Owner

@eth-p eth-p left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great find! Thank you for adding this fix! I'll merge it right after this.

A small tip for you in the future, if you want to know something cool:

One of the features that bash implements as a bash-ism called "herestring" is that you can feed a string directly into the standard input of a command without going through printf or echo first:

cut -d, -f1 <<< "$selected_page"

@eth-p eth-p merged commit ac4f871 into eth-p:master Aug 24, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants