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

Limit what options may go into an ackrc file #157

Open
petdance opened this issue Oct 11, 2018 · 4 comments
Open

Limit what options may go into an ackrc file #157

petdance opened this issue Oct 11, 2018 · 4 comments
Labels

Comments

@petdance
Copy link
Collaborator

petdance commented Oct 11, 2018

The way that ack treats the ackrc file like just another source of command line arguments is dangerous. There's no legit reason for someone to put, say, -f or -g or --match or --output or -c or -x in their ackrc file.

The list of options that seem sensible to me are: -i, -S, --column, -s, --pager, --heading, --break, --group, --proximate, --underline, --color*, --flush, --sort-files, --ignore*, -r, -n, --follow, --type-add, --type-set, --type, -k, -A, -B, -C.

Basically anything that regulates behavior vs. regulating output should be forbidden.

@petdance petdance added the bug label Oct 11, 2018
@petdance
Copy link
Collaborator Author

This is related to #57. The way we decide what options are mutex is tied to groups of options and their meaning.

@petdance
Copy link
Collaborator Author

Certain options are "actions", for lack of a better word. These can only be on the command line.

-v
-Q
--lines
--match
-l
-L
-o
--output
--passthru
-c
-f
-g
-print0 (only works with other actions)
--show-types
--files-from
-x
--help-types
--version
--ackrc
--create-ackrc
--dump
--help
--man
--faq
--cookbook
--thpppt
--bar
--cathy

@n1vux
Copy link
Contributor

n1vux commented Oct 11, 2018

Makes sense. And not really much extra work since we're already filtering a few for security.

@n1vux
Copy link
Contributor

n1vux commented Oct 11, 2018

(Although putting --cathy or --thpppt in a project .ackrc would be an amusing prank.)

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

No branches or pull requests

2 participants