Skip to content

Commit

Permalink
refactor: rename attrs to print_attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
alaaeddineelamri authored and arogge committed Mar 2, 2023
1 parent a18c39a commit f0f52c7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions core/src/dird/testfind.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ int main(int argc, char* const* argv)
CLI::App testfind_app;
InitCLIApp(testfind_app, "The Bareos Testfind Tool.", 2000);

bool attrs = false;
testfind_app.add_flag("-a,--print-attributes", attrs,
bool print_attributes = false;
testfind_app.add_flag("-a,--print-attributes", print_attributes,
"Print extended attributes (Win32 debug).");

std::string configfile = ConfigurationParser::GetDefaultConfigDir();
Expand Down Expand Up @@ -106,7 +106,7 @@ int main(int argc, char* const* argv)
exit(1);
}

launchFileDaemonLogic(dir_fileset, configfile.c_str(), attrs);
launchFileDaemonLogic(dir_fileset, configfile.c_str(), print_attributes);

if (my_config) {
delete my_config;
Expand Down
8 changes: 4 additions & 4 deletions core/src/dird/testfind_jcr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static int max_file_len = 0;
static int max_path_len = 0;
static int trunc_fname = 0;
static int trunc_path = 0;
static int local_attrs = 0;
static bool print_attributes = false;

static int handleFile(JobControlRecord* jcr,
FindFilesPacket* ff_pkt,
Expand All @@ -56,9 +56,9 @@ static int handleFile(JobControlRecord* jcr,

void launchFileDaemonLogic(directordaemon::FilesetResource* jcr_fileset,
const char* configfile,
bool attrs)
bool print_attrs)
{
local_attrs = attrs;
print_attributes = print_attrs;
crypto_cipher_t cipher = CRYPTO_CIPHER_NONE;

my_config = InitFdConfig(configfile, M_ERROR_TERM);
Expand Down Expand Up @@ -365,7 +365,7 @@ int PrintFile(JobControlRecord*, FindFilesPacket* ff, bool)
printf(_("Err: Unknown file ff->type %d: %s\n"), ff->type, ff->fname);
break;
}
if (local_attrs) {
if (print_attributes) {
char attr[200];
// encode_attribsEx(NULL, attr, ff);
if (*attr != 0) { printf("AttrEx=%s\n", attr); }
Expand Down
2 changes: 1 addition & 1 deletion core/src/dird/testfind_jcr.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

void launchFileDaemonLogic(directordaemon::FilesetResource* jcr_fileset,
const char* configfile,
bool attrs);
bool print_attrs);
void SetOptions(findFOPTS* fo, const char* opts);
bool setupFileset(FindFilesPacket* ff,
directordaemon::FilesetResource* jcr_fileset);
Expand Down

0 comments on commit f0f52c7

Please sign in to comment.