bees.o \
bees-config-v1.o \
bees-config.o \
+ bees-usage.o \
bees-context.o \
bees-fdcache.o \
bees-hash.o \
printf 'const char *BEES_VERSION = "%s";\n' "$$(BEES_VERSION="$(BEES_VERSION)" ../scripts/bees-version .. | sed 's/\\/\\\\/g;s/"/\\"/g')" > bees-version.c.new
if ! [ -e "$@" ] || ! cmp -s "$@.new" "$@"; then mv -fv $@.new $@; else rm -f $@.new; fi
-bees-usage.c: bees-usage.txt Makefile
- (echo 'const char *BEES_USAGE = '; sed -r 's/^(.*)$$/"\1\\n"/' < bees-usage.txt; echo ';') > bees-usage.new.c
- mv -f bees-usage.new.c bees-usage.c
# The generated dependencies name the compiler's own header paths, so they are
# stale after a toolchain switch too. These files are `include'd, not
%.o: %.cc $(BUILD_CONF)
$(CXX) $(BEES_CXXFLAGS) -o $@ -c $<
-$(BEES): $(BEES_OBJS) bees-version.o bees-usage.o ../lib/libcrucible.a
+$(BEES): $(BEES_OBJS) bees-version.o ../lib/libcrucible.a
$(CXX) $(BEES_CXXFLAGS) $(BEES_LDFLAGS) -o $@ $^ $(LIBS)
clean:
--- /dev/null
+/// @file bees-usage.cc
+/// Usage / help text for the bees binary.
+///
+/// Kept as a raw-string literal to avoid a Makefile text-generation step and
+/// to make the string visible to tools (grep, git log -p) without escaping.
+
+const char *BEES_USAGE = R"(Usage: %s [options] fs-root-path
+Performs best-effort extent-same deduplication on btrfs.
+
+fs-root-path MUST be the root of a btrfs filesystem tree (subvol id 5).
+Other directories will be rejected.
+
+Options:
+ -h, --help Show this help and exit
+ --version Print version information and exit
+
+ --config FILE Read configuration options from FILE
+ -o, --option Set one configuration option in `key=value` format
+
+Configuration debug options:
+ --write-trusted-config FILE
+ Dump the merged trusted configuration view to FILE
+ and exit without running dedupe. FILE may be '-'
+ for stdout. Trusted view: only config files loaded
+ from absolute paths can override [paths] keys.
+ See `docs/options.md` for details.
+
+ --write-untrusted-config FILE
+ Dump the merged untrusted configuration view to FILE
+ and exit without running dedupe. FILE may be '-'
+ for stdout. Untrusted view: all sources (including
+ relative-path local config files) are included.
+ See `docs/options.md` for details.
+
+Load management options:
+ -c, --thread-count Exact worker thread count (overrides factor)
+ [thread.thread-max]
+ -C, --thread-factor Worker thread factor: threads per CPU (default 1)
+ [thread.thread-factor]
+ -G, --thread-min Minimum worker thread count (default 0)
+ [thread.thread-min]
+ -g, --loadavg-target Target load average for worker threads (default none)
+ [thread.loadavg-target]
+ --throttle-factor Idle time between operations (default 1.0)
+ [throttle.factor]
+
+Filesystem tree traversal options:
+ -m, --scan-mode MODE Scanning mode (0..4, default 4)
+ 0..3: subvol scan [scan.subvol.active=yes, scan.subvol.mode=N, scan.extent.*.active=no]
+ 4: extent scan [scan.subvol.active=no, scan.extent.*.active=yes]
+
+Workarounds:
+ -a, --workaround-btrfs-send Workaround for btrfs send
+ (ignore RO snapshots)
+
+Logging options:
+ -t, --timestamps Show timestamps in log output (default)
+ [log.timestamps = yes]
+ -T, --no-timestamps Omit timestamps in log output
+ [log.timestamps = no]
+ -p, --absolute-paths Show absolute paths (default)
+ [log.strip-paths = no]
+ -P, --strip-paths Strip fs-root-path from beginning of all paths in the log
+ [log.strip-paths = yes]
+ -v, --verbose N Set maximum log level (0..8, default 8)
+ [log.level]
+
+Optional environment variables:
+ BEESHOME Path to hash table and checkpoint files
+ (default is .beeshome/ in the root of the filesystem).
+ [path.home]
+
+ BEESSTATUS Compatibility shortcut for report.legacy.filename and
+ report.legacy.active=yes.
+ [report.legacy.filename] [report.legacy.active]
+)";
+++ /dev/null
-Usage: %s [options] fs-root-path
-Performs best-effort extent-same deduplication on btrfs.
-
-fs-root-path MUST be the root of a btrfs filesystem tree (subvol id 5).
-Other directories will be rejected.
-
-Options:
- -h, --help Show this help and exit
- --version Print version information and exit
-
- --config FILE Read configuration options from FILE
- -o, --option Set one configuration option in `key=value` format
-
-Load management options:
- -c, --thread-count Exact worker thread count (overrides factor)
- [thread.thread-max]
- -C, --thread-factor Worker thread factor: threads per CPU (default 1)
- [thread.thread-factor]
- -G, --thread-min Minimum worker thread count (default 0)
- [thread.thread-min]
- -g, --loadavg-target Target load average for worker threads (default none)
- [thread.loadavg-target]
- --throttle-factor Idle time between operations (default 1.0)
- [throttle.factor]
-
-Filesystem tree traversal options:
- -m, --scan-mode MODE Scanning mode (0..4, default 4)
- 0..3: subvol scan [scan.subvol.active=yes, scan.subvol.mode=N, scan.extent.*.active=no]
- 4: extent scan [scan.subvol.active=no, scan.extent.*.active=yes]
-
-Workarounds:
- -a, --workaround-btrfs-send Workaround for btrfs send
- (ignore RO snapshots)
-
-Logging options:
- -t, --timestamps Show timestamps in log output (default)
- [log.timestamps = yes]
- -T, --no-timestamps Omit timestamps in log output
- [log.timestamps = no]
- -p, --absolute-paths Show absolute paths (default)
- [log.strip-paths = no]
- -P, --strip-paths Strip fs-root-path from beginning of all paths in the log
- [log.strip-paths = yes]
- -v, --verbose N Set maximum log level (0..8, default 8)
- [log.level]
-
-Optional environment variables:
- BEESHOME Path to hash table and checkpoint files
- (default is .beeshome/ in the root of the filesystem).
- [path.home]
-
- BEESSTATUS Compatibility shortcut for report.legacy.filename and
- report.legacy.active=yes.
- [report.legacy.filename] [report.legacy.active]