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 Configure File Support - Version 2 #709
base: master
Are you sure you want to change the base?
Conversation
Implementation is based on PR ggreer#257, authored by David Schlosnagle. Ag reads OPTIONS from one of several configuration files. Ag processes "config file" options before command-line options. The config file format is very simple: # this is a comment => inline comments not supported # blank lines okay as well --long-option[=value] -short-option[=value] --long-option[ value] -short-option[ value] # And special keywords (of which there is only one) list Actual Example Config File ========================== # set up nice colors for a white terminal bkgnd... # bold blue --color-line-number=1;34 # black with grey bkgnd --color-match=30;47 # green --color-path=32 If the keyword "list" is included in a config file, ag dumps the contents of argv[] on stdout. This is useful for debugging config file errors that cause ag to output a usage message and then silently exit. Ag reads configuration information from a number of possible locations, in the following order (first file found is used, all others ignored): 1. Path specified in $AGRC_PATH 2. $XDG_CONFIG_HOME/agrc 3. ~/.agrc 4. /usr/local/etc/agrc 5. /etc/agrc
@ggreer Are you considering this? |
@ggreer fell on this today. any chance it will be merged? |
👍 This would be a lot better than aliasing |
I would also love to see a defaults file. I have had trouble switching to For what it's worth, I got here via (!):
It would be nice if the file could be located either at As a user of |
@ggreer please consider this. I'm coming from ack and truly miss this. |
+1 |
I would say that current PR has some flaws:
|
.nf | ||
1. \fIPath specified in $AGRC_PATH\fR | ||
.br | ||
2. \fI$XDG_CONFIG_HOME/agrc\fR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would strongly suggest this not be put directly into the XDG_CONFIG_HOME
. Instead, I would suggest using a subdirectory of XDG_CONFIG_HOME
the same way git and others do: $XDG_CONFIG_HOME/ag/agrc
. It's been suggested in #1020 that the ignore lookup should also conform to XDG spec, and having these all in a single directory makes more sense than proliferating directly in the root of $XDG_CONFIG_HOME
Fix Conflicts: Makefile.am doc/ag.1
…erge Config file support v2 - ported merge of ggreer#709
Implementation is based on PR #257, authored by David Schlosnagle.
Ag reads OPTIONS from one of several configuration files. Ag processes "config
file" options before command-line options. The config file format is very
simple:
If the keyword "list" is included in a config file, ag dumps the contents of
argv[] on stdout. This is useful for debugging config file errors that cause
ag to output a usage message and then silently exit.
Ag reads configuration information from a number of possible locations,
in the following order (first file found is used, all others ignored):