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

fish --no-execute reports "Unknown command" for functions #977

Closed
paynechu opened this issue Aug 26, 2013 · 9 comments
Closed

fish --no-execute reports "Unknown command" for functions #977

paynechu opened this issue Aug 26, 2013 · 9 comments
Labels
bug Something that's not working as intended
Milestone

Comments

@paynechu
Copy link

I reported here before.
dag/vim-fish#16 (comment)

@KamilaBorowska
Copy link
Contributor

eval is a function, and --no-execute doesn't try to check whatever function exists or not.

~ $ fish --no-execute --help
fish: Unknown command '__fish_print_help'
Standard input: __fish_print_help fish
                ^

(ok, that is a bug)

This ought to be fixed, but in certain cases executing code is needed (some functions, like . aren't defined in files, but in initialization script).

@zanchey
Copy link
Member

zanchey commented Aug 27, 2013

--no-execute doesn't work in fish 2.0 for me either:

> fish --no-execute echo
open: No such file or directory

@KamilaBorowska
Copy link
Contributor

@zanchey:

Of course it doesn't. You want to check syntax of echo file, but no such file exists (then again, the error message could be less confusing).

~ $ fish --no-execute -c echo
~ $

@zanchey
Copy link
Member

zanchey commented Aug 27, 2013

Ah, of course.

@lilyball
Copy link
Contributor

lilyball commented Sep 9, 2014

This bit me when updating the tests, because test.fish runs fish -n on itself. This meant that I couldn't use type inside the test file.

I'm inclined to say that when -n is set, fish should treat unknown commands as valid.

The real issue here is functions that are loaded from $fish_function_path, as that never ends up getting set, which means autoload can't trigger. Presumably functions provided by a file that's sourced from the config file won't work either, but I haven't tested that.

@lilyball lilyball added the bug Something that's not working as intended label Sep 9, 2014
@faho faho changed the title fish --no-execute report Unknown command 'eval' fish --no-execute reports "Unknown command" for functions Jan 7, 2017
@krader1961 krader1961 added enhancement and removed bug Something that's not working as intended labels Apr 1, 2017
@krader1961
Copy link
Contributor

Relabeling this from "bug" to "enhancement" because the current behavior seems reasonable and is not in contradiction of the documentation. Whether we can provide a better experience is TBD.

@actionless
Copy link
Contributor

what about having sorta shim loaded when running fish -n

so in that shim abbr and alias would be defined

@ulidtko
Copy link

ulidtko commented Jan 9, 2020

Relabeling this from "bug" to "enhancement" because the current behavior seems reasonable and is not in contradiction of the documentation

Please let me disagree. The current behavior, by far, doesn't seem reasonable.

There can be no valid reason to flag errors when "syntax checking" code which works correctly, runs perfectly fine; this isn't linting.

--no-execute is broken, and should be clearly labelled as such. See #6484.

@faho faho closed this as completed in 3f5c60e Feb 17, 2020
faho added a commit that referenced this issue Feb 17, 2020
This made some output for non-execution.

See #977.
@actionless
Copy link
Contributor

thanks a lot! works for me now

@zanchey zanchey modified the milestones: fish-future, fish 3.2.0 Feb 19, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something that's not working as intended
Projects
None yet
Development

No branches or pull requests

8 participants