Repository navigation
Configuration
Precedence, lowest to highest:
- built-in defaults
- /etc/sr/sr.conf system wide
- $XDG_CONFIG_HOME/sr/sr.conf user (default ~/.config/sr/sr.conf)
- /.srrc, /.srrc, project (walked upwards, stops at /.sr/sr.conf the repository boundary)
- $SR_CONFIG an extra file
- --config-file FILE an extra file, explicitly
- SR_* environment variables
- --config KEY=VALUE
- command line flags
Syntax — a small, forgiving INI dialect:
# a comment
ignore-case = true # applies to every command
exclude = *.min.js, dist # comma or whitespace separated list
[replace] # applies to `sr replace` only
backup = false
confirm-threshold = 500
[find]
context = 1
Rules:
- keys are the option names ('-' and '_' are interchangeable)
-
keyalone meanskey = true - booleans accept true/false/yes/no/on/off/1/0
- sizes accept 512, 4KB, 10MB, 1.5GiB; durations accept 30s, 5m, 7d
- repeating a key builds a list
- an unknown key or an invalid value is a hard error with file:line — a silently ignored typo is exactly what a bulk-edit tool must not have
Commands:
sr config list --show-origin every option, its value, where it came from sr config show confirm-threshold sr config init write a documented template sr config init --file .srrc …into the project instead sr config path the files sr would read, in order sr config validate parse every file and report errors
A project .srrc is worth committing: it makes the team's exclusion list, confirmation threshold and backup policy part of the repository instead of tribal knowledge.
Страница сгенерирована из встроенной справки sr 7.0.1 (sr help <topic>).
Первоисточник — sr/help_system.py; он же питает man sr и sr help --all.
Если страница и вывод sr help расходятся, верить нужно sr help: он всегда
соответствует установленной версии.