Command-Line documentation

bronto-refactor

This document contains the help content for the bronto-refactor command-line program.

bronto-refactor

Usage: bronto-refactor <COMMAND>

Subcommands:
  • run — Runs the tool, generating edits in the .fossil format
  • merge — Takes one or more .fossil files and merges them into a single file
  • format — Converts edit-describing files between supported formats
  • apply — Takes one or more .fossil files and applies the changes
  • count — Reports the number of lines modifiable by the tool
  • compiler-explorer — Version of the tool designed to interact with Compiler Explorer

bronto-refactor run

Runs the tool, generating edits in the .fossil format

Usage: bronto-refactor run [OPTIONS] --output <OUTPUT> [CLANG]...

Arguments:
  • <CLANG> — Arguments to be passed to Clang. Must not be specified if --db is present
Options:
  • -o, --output <OUTPUT> — The location to write the .fossil file

  • --config <CONFIG> — The location of a TOML configuration file controlling this tool

  • --interactive — Indicates whether the tool is being run interactively. Defaults to true. Can use --no-interactive for false

    Default value: true

  • --volatile — If true, processing will happen whether or not a cached result already exists. Caching is keyed on the compilation command, not the content of the files being processed

  • --clang-path <CLANG_PATH> — The path to an instance of Clang installed on this machine from which we can detect the system include directories

  • --db <DB> — Location of a compilations database JSON file. Must not be specified if clang arguments are directly supplied

  • -j, --jobs <JOBS> — Number of threads on which to process input. If not provided, a reasonable default will be chosen. There are no guarantees about the specific value chosen, but a reasonable effort is made to detect an appropriate number for the host system

  • --include <INCLUDE> — Paths to header files to be included in every translation unit while processing. Typically this is used to include refactoring recipes that don't otherwise have a reasonable existing header to live in

  • --retain <RETAIN> [alias: filter] — A glob that filters keys in the compilation database referenced via --db. Only entries in the compilation database that match the glob will be processed

    Default value: **

bronto-refactor merge

Takes one or more .fossil files and merges them into a single file

Usage: bronto-refactor merge [OPTIONS] --output <OUTPUT> <--manifest <MANIFEST>|FILES>

Arguments:
  • <FILES> — A sequence of .fossil files
Options:
  • --output <OUTPUT> — The location the merged .fossil file should be written to
  • --log-to-stderr
  • --manifest <MANIFEST> — A file containing a newline-separated list of all .fossil files

bronto-refactor format

Converts edit-describing files between supported formats

Usage: bronto-refactor format [OPTIONS] --from <FROM> --to <TO> --input <INPUT> --output <OUTPUT>

Options:
  • -f, --from <FROM>

    Possible values: fossil, patch

  • -t, --to <TO> — The format into which the file should be converted

    Possible values: fossil, patch

  • -i, --input <INPUT> — The input file to be reformatted

  • -o, --output <OUTPUT> — The location the output file should be written to

  • --log-to-stderr

bronto-refactor apply

Takes one or more .fossil files and applies the changes

Usage: bronto-refactor apply [OPTIONS] <--manifest <MANIFEST>|FILES>

Arguments:
  • <FILES> — A sequence of .fossil files
Options:
  • --config <CONFIG> — The location of a TOML configuration file controlling this tool

  • --interactive — Indicates whether the tool is being run interactively. Defaults to true. Can use --no-interactive for false

    Default value: true

  • --manifest <MANIFEST> — A file containing a newline-separated list of all .fossil files

bronto-refactor count

Reports the number of lines modifiable by the tool

Usage: bronto-refactor count [OPTIONS] [CLANG]...

Arguments:
  • <CLANG> — Arguments to be passed to Clang. Must not be specified if --db is present
Options:
  • --depth <DEPTH> — Display line counts totals for directories up to this depth

    Default value: 1

  • --config <CONFIG> — The location of a TOML configuration file controlling this tool

  • --interactive — Indicates whether the tool is being run interactively. Defaults to true. Can use --no-interactive for false

    Default value: true

  • --volatile — If true, processing will happen whether or not a cached result already exists. Caching is keyed on the compilation command, not the content of the files being processed

  • --clang-path <CLANG_PATH> — The path to an instance of Clang installed on this machine from which we can detect the system include directories

  • --db <DB> — Location of a compilations database JSON file. Must not be specified if clang arguments are directly supplied

  • -j, --jobs <JOBS> — Number of threads on which to process input. If not provided, a reasonable default will be chosen. There are no guarantees about the specific value chosen, but a reasonable effort is made to detect an appropriate number for the host system

  • --include <INCLUDE> — Paths to header files to be included in every translation unit while processing. Typically this is used to include refactoring recipes that don't otherwise have a reasonable existing header to live in

  • --retain <RETAIN> [alias: filter] — A glob that filters keys in the compilation database referenced via --db. Only entries in the compilation database that match the glob will be processed

    Default value: **

bronto-refactor compiler-explorer

Version of the tool designed to interact with Compiler Explorer

Usage: bronto-refactor compiler-explorer [OPTIONS] <FILE> [CLANG]...

Arguments:
  • <FILE> — The file whose modified contents should be displayed
  • <CLANG> — Arguments to be passed to Clang
Options:
  • -c, --clang-path <CLANG_PATH> — The path to an instance of Clang installed on this machine from which we can detect the system include directories

  • --clang-format-path <CLANG_FORMAT_PATH> — The path to an instance of clang-format installed on this machine

  • -o, --output <OUTPUT> — The location to write the modified file contents, or stdout if not provided

  • --include <INCLUDE> — Paths to header files to be included in every translation unit while processing. Typically this is used to include refactoring recipes that don't otherwise have a reasonable existing header to live in

  • --log-to-stderr

    Default value: true

  • --config <CONFIG> — The location of a TOML configuration file controlling this tool

On this page