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

Add new "pip-search" command #17

Closed
5 tasks
E3V3A opened this issue Sep 26, 2020 · 3 comments
Closed
5 tasks

Add new "pip-search" command #17

E3V3A opened this issue Sep 26, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@E3V3A
Copy link
Owner

E3V3A commented Sep 26, 2020

As it is, pip search <dog> just sucks.

Because it doesn't:

  • sort the result list
  • column align the "version" string
  • show last upload date
  • show last (repo) commit time, if available.
  • truncate "summary" to fit screen

We add a new pip-search command as an artificial quasi-wrapper to "pip search".

NO ETA... as I'm tired of 2020

@E3V3A E3V3A added the enhancement New feature or request label Sep 26, 2020
@E3V3A
Copy link
Owner Author

E3V3A commented Jan 22, 2022

I now have a nice search command! - Coming soon! 👍

@E3V3A
Copy link
Owner Author

E3V3A commented Jan 22, 2022

Then there is the awesome Powershell pip search hack from our colleagues at pip_search from their PR #15 from here.

Add the following to your $PROFILE:

Function PipSearchProxy() {
	param(
		[string]
		[Parameter(Position=0)]
		$firstArg,
		[string[]]
		[Parameter(Position=1, ValueFromRemainingArguments)]
		$allRemaining)
	if ($firstArg -eq "search") {
		& pip-search @allRemaining
	} else {
		& pip.exe $firstArg @allRemaining
	}
}
Set-Alias -Name pip -Value PipSearchProxy

Which allow you to run it with the classic pip search. (It wraps the args.)

@E3V3A E3V3A closed this as completed in 274198c Jan 23, 2022
@E3V3A
Copy link
Owner Author

E3V3A commented Jan 24, 2022

For using the same old way of doing pip search <something> in Bash-style shells,
add the following to your .zshrc, .bashrc, .bash_profile:

alias pip='function _pip(){
    if [ $1 = "search" ]; then
        pip_search "$2";
    else pip "$@";
    fi;
};_pip'

or written in a cleaner way:

function _pip_search_proxy(){
    if [ $1 = "search" ]; then
        pip_search "$2";
    else pip "$@";
    fi;
}

alias pip='_pip_search_proxy'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant