MCPcopy Create free account
hub / github.com/apache/nifi-minifi-cpp / main

Function main

encrypt-config/EncryptConfigMain.cpp:29–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27using org::apache::nifi::minifi::encrypt_config::CommandException;
28
29int main(int argc, char* argv[]) try {
30 Arguments args = Arguments::parse(argc, argv);
31 EncryptConfig encrypt_config{args.get("-m").value()};
32 EncryptConfig::EncryptionType type = encrypt_config.encryptSensitiveProperties();
33 if (args.isSet("--encrypt-flow-config")) {
34 encrypt_config.encryptFlowConfig();
35 } else if (type == EncryptConfig::EncryptionType::RE_ENCRYPT) {
36 std::cout << "WARNING: you did not request the flow config to be updated, "
37 << "if it is currently encrypted and the old key is removed, "
38 << "you won't be able to recover the flow config.\n";
39 }
40 return 0;
41} catch (const CommandException& c_ex) {
42 std::cerr << c_ex.what() << "\n";
43 std::cerr << Arguments::getHelp() << "\n";
44 return 1;
45} catch (const std::exception& ex) {
46 std::cerr << ex.what() << "\n(" << typeid(ex).name() << ")\n";
47 return 2;
48} catch (...) {
49 std::cerr << "Unknown error\n";
50 return 3;
51}

Callers

nothing calls this directly

Calls 7

valueMethod · 0.80
isSetMethod · 0.80
encryptFlowConfigMethod · 0.80
nameMethod · 0.80
getMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected