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

type -p and type -P behaviors are at odds with its documentation #6411

Closed
hivehand opened this issue Dec 10, 2019 · 2 comments
Closed

type -p and type -P behaviors are at odds with its documentation #6411

hivehand opened this issue Dec 10, 2019 · 2 comments
Labels
bug
Milestone

Comments

@hivehand
Copy link
Contributor

@hivehand hivehand commented Dec 10, 2019

fish: 3.0.2-1940-g15c6d8fd-dirty
macOS: 10.14.6
iTerm 2: 3.3

type -p and type -P do not currently behave, in all cases, as their documentation indicates.

xs is a function defined in its own file.
xa is an interactively-defined function.
frotz is a random word referring to neither a function nor an executable.

Neither of the functions have executable counterparts.

Invoking type -p xs, produces the path to its file, as expected.
Invoking type -p xa, produces a single dash (-) as output, rather than nothing.
Invoking type -p frotz, produces type: Could not find 'frotz', rather than nothing.

Invoking type -P on all of the above produces type: Could not find '<argument>', rather than nothing.

I believe that I have a fix for these in place, and will submit it shortly.

@faho
Copy link
Member

@faho faho commented Dec 11, 2019

Invoking type -p xa, produces a single dash (-) as output, rather than nothing.

I can't reproduce this.

For me, it works like this:

$ function banana; echo banana; end
$ functions --details banana
stdin
$ type -p banana
$

functions --details does not print "-", it prints "stdin" like documented?

@hivehand
Copy link
Contributor Author

@hivehand hivehand commented Dec 12, 2019

Sorry. As I just noted in #6407, it turns out that only functions created by alias cause functions --details to emit a dash. This does not affect the implementation of type in the current release (3.0.2), but it does affect type at top-of-tree. I think that the fix for that aspect of the issue is a one-liner, and will update my related pull request shortly.

@faho faho added this to the fish 3.1.0 milestone Dec 12, 2019
@faho faho closed this Dec 12, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug
Projects
None yet
Development

No branches or pull requests

2 participants