mirror of
https://github.com/Zygo/bees.git
synced 2025-08-02 22:03:29 +02:00
Merge branch 'master' into subvol-threads
This commit is contained in:
24
src/bees.cc
24
src/bees.cc
@@ -37,6 +37,8 @@ do_cmd_help(char *argv[])
|
||||
"\t-h, --help\t\tShow this help\n"
|
||||
"\t-t, --timestamps\tShow timestamps in log output (default)\n"
|
||||
"\t-T, --notimestamps\tOmit timestamps in log output\n"
|
||||
"\t-p, --absolute-paths\tShow absolute paths (default)\n"
|
||||
"\t-P, --relative-paths\tShow paths relative to $CWD\n"
|
||||
"\n"
|
||||
"Optional environment variables:\n"
|
||||
"\tBEESHOME\tPath to hash table and configuration files\n"
|
||||
@@ -611,6 +613,8 @@ bees_main(int argc, char *argv[])
|
||||
|
||||
THROW_CHECK1(invalid_argument, argc, argc >= 0);
|
||||
|
||||
string cwd(readlink_or_die("/proc/self/cwd"));
|
||||
|
||||
// Defaults
|
||||
bool chatter_prefix_timestamp = true;
|
||||
|
||||
@@ -619,12 +623,14 @@ bees_main(int argc, char *argv[])
|
||||
while (1) {
|
||||
int option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
{ "timestamps", no_argument, NULL, 't' },
|
||||
{ "notimestamps", no_argument, NULL, 'T' },
|
||||
{ "help", no_argument, NULL, 'h' }
|
||||
{ "timestamps", no_argument, NULL, 't' },
|
||||
{ "notimestamps", no_argument, NULL, 'T' },
|
||||
{ "absolute-paths", no_argument, NULL, 'p' },
|
||||
{ "relative-paths", no_argument, NULL, 'P' },
|
||||
{ "help", no_argument, NULL, 'h' }
|
||||
};
|
||||
|
||||
c = getopt_long(argc, argv, "Tth", long_options, &option_index);
|
||||
c = getopt_long(argc, argv, "TtPph", long_options, &option_index);
|
||||
if (-1 == c) {
|
||||
break;
|
||||
}
|
||||
@@ -636,6 +642,12 @@ bees_main(int argc, char *argv[])
|
||||
case 't':
|
||||
chatter_prefix_timestamp = true;
|
||||
break;
|
||||
case 'P':
|
||||
crucible::set_relative_path(cwd);
|
||||
break;
|
||||
case 'p':
|
||||
crucible::set_relative_path("");
|
||||
break;
|
||||
case 'h':
|
||||
do_cmd_help(argv); // fallthrough
|
||||
default:
|
||||
@@ -645,6 +657,10 @@ bees_main(int argc, char *argv[])
|
||||
|
||||
Chatter::enable_timestamp(chatter_prefix_timestamp);
|
||||
|
||||
if (!relative_path().empty()) {
|
||||
BEESLOG("using relative path " << relative_path() << "\n");
|
||||
}
|
||||
|
||||
// There can be only one because we measure running time with it
|
||||
bees_ioctl_lock_set.max_size(1);
|
||||
|
||||
|
Reference in New Issue
Block a user