Bump is a command-line tool for managing and modifying values in multiple files using a configuration file (bump.cfg
). It supports various methods of identifying and modifying values, including tags, line/column positions, and regular expressions.
Ensure you have Python 3 installed. Place the script in a directory included in your system's PATH
and make it executable:
chmod +x bumpy/bump
cp bumpy/bump /usr/local/bin/bump
You can also just run the install.sh
script which should do the same in most cases.
bump init
Creates an empty bump.cfg
if it does not already exist.
Any bump command will use the bump.cfg file in the immediate directory, the future promises much more.
bump add tag <name> <filepath> <tag> [options]
<name>
: Identifier for the entry inbump.cfg
.<filepath>
: Path to the target file.<tag>
: The string identifying the line to modify.- Options:
-f, --flags <flags>
: Optional flags for filtering.-w, --wrapper <char>
: Wrap the value with a character (e.g., quotes).-o, --occurences <indices>
: Specify which occurrences to modify (integer, list, orall
).
bump add lc <name> <filepath> <line> <column> [options]
<line>
: Line number (zero-based index).<column>
: Column position after which the value is placed.- Options: Same as tag-based entry.
bump add regex <name> <filepath> <regex> [options]
<regex>
: Regular expression to match values.- Options:
-g, --group <int>
: Capture group number to update.-o, --occurences <indices>
: Specify which matches to modify.
bump get [-e <flags>] [-o <flags>]
-e, --except <flags>
: Exclude entries with specified flags.-o, --only <flags>
: Include only entries with specified flags.
bump set <value> [-e <flags>] [-o <flags>]
<value>
: The new value to be set.- Filtering options are the same as for
bump get
.
bump remove <name>
Removes the specified entry from bump.cfg
.
-
Initialize Configuration:
bump init
-
Add a Tag-Based Entry:
bump add tag version ./config.txt VERSION= -w '"'
-
Get Values:
bump get
-
Set a New Value:
bump set "2.0.1"
-
Remove an Entry:
bump remove version