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

(maint) only check builtin_command? for posix #2518

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tvpartytonight
Copy link
Contributor

The builtin_command? only is useful in posix, where the type
function is defined. Windows Powershell does not have type defined.

@tvpartytonight tvpartytonight requested a review from a team as a code owner August 29, 2022 16:42
The `builtin_command?` only is useful in posix, where the `type`
function is defined. Windows Powershell does not have `type` defined.
@tvpartytonight tvpartytonight force-pushed the maint_call_builtin_command_posix_only branch from 39815b8 to 8075009 Compare August 29, 2022 16:46
@tvpartytonight
Copy link
Contributor Author

This is related to #2517 ; I didn't want to change some of the logic here or change the expand default set, so I moved the logic to the which in that PR and just submitted this patch separately to keep it cleaner.

output.chomp =~ /builtin/ ? true : false
# optional function to be defined in subclass if necessary
def builtin_command?(_command_)
nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe keep false for consistency? Also the "Ruby way" for unused variable is to name them _variable.

Overall LGTM.

@CLAassistant
Copy link

CLAassistant commented Apr 19, 2023

CLA assistant check
All committers have signed the CLA.

@joshcooper
Copy link
Contributor

@tvpartytonight is this still needed? If so, I agree with @smortex's comments.

@joshcooper
Copy link
Contributor

Coming back to this, is this still needed? It looks like PowerShell can query if a command is a function like https://superuser.com/questions/1648302/powershell-equivalent-of-unix-shell-buitin-type But I'm not sure that'd be useful here?

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.

4 participants