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

-k is mostly useless #83

Open
refi64 opened this issue Jun 4, 2016 · 5 comments
Open

-k is mostly useless #83

refi64 opened this issue Jun 4, 2016 · 5 comments

Comments

@refi64
Copy link

refi64 commented Jun 4, 2016

By default, --known-types is on. And there's no way to turn it off! In particular, this means that there's no reason for -k, since the feature is already on. Idea: make -k be an "off" switch for it.

@gvansickle
Copy link
Owner

Hi @kirbyfan64 . I added -k for command-line compatibility with ack. It defaults to on because that's currently the only way ucg works: a file has to match it's list of known file types, or it gets ignored under the assumption that it's either binary or of no interest to the user.
I do intend at some point to add support for scanning all files which look like text by default (which is what ack and ag do now), and then that option will have some meaning.

@refi64
Copy link
Author

refi64 commented Jun 9, 2016

@gvansickle Ah, that makes sense! Is there a way to explicitly scan file extensions that ucg doesn't know about? I would a lot with languages that aren't super-popular, so ucg ends up always showing nothing when I use it on those projects.

@gvansickle
Copy link
Owner

Hi @kirbyfan64 .

Is there a way to explicitly scan file extensions that ucg doesn't know about?

Well, there's a way to make ucg know about new extensions: the File Type Specification feature. For each new language, you add a line like this to your ~/.ucgrc file:

# Extensions .abc, .xqz, and .def are SomeNewLanguage1 source files
--type-add=SomeNewLanguage1:ext:abc,xqz,def
...[repeat as necessary]...

You do that once, and then ucg will treat files with those extensions just like they were builtins. You can have project .ucgrc files as well, if you have wildly different needs for different project directories.

Now admittedly, if you don't know the extensions (or literal names, e.g. Makefile) beforehand, that feature doesn't do you much good; like I mentioned above, when I have enough of those round tuits, I'll make "the opposite of -k" actually work.

@refi64
Copy link
Author

refi64 commented Jun 11, 2016

@gvansickle Sweet, that works! Do you want me to close this now?

@gvansickle
Copy link
Owner

gvansickle commented Jun 11, 2016

@kirbyfan64 No, I'll close it when I do the final merge.
EDIT: Sorry, I thought we were on the other issue ;-). But still, leave this open. This is the issue I'll use to add the "real opposite-of--k" functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants