| 1460 | } |
| 1461 | |
| 1462 | static void register_opts(struct lightningd *ld) |
| 1463 | { |
| 1464 | /* This happens before plugins started */ |
| 1465 | clnopt_noarg("--test-daemons-only", OPT_EARLY|OPT_EXITS, |
| 1466 | test_subdaemons_and_exit, |
| 1467 | ld, |
| 1468 | "Test that subdaemons can be run, then exit immediately"); |
| 1469 | /* We need to know this even before we talk to plugins */ |
| 1470 | clnopt_witharg("--allow-deprecated-apis", |
| 1471 | OPT_EARLY|OPT_SHOWBOOL, |
| 1472 | opt_set_bool_arg, opt_show_bool, |
| 1473 | &ld->deprecated_ok, |
| 1474 | "Enable deprecated options, JSONRPC commands, fields, etc."); |
| 1475 | /* Register plugins as an early args, so we can initialize them and have |
| 1476 | * them register more command line options */ |
| 1477 | clnopt_witharg("--plugin", OPT_MULTI|OPT_EARLY, |
| 1478 | opt_add_plugin, NULL, ld, |
| 1479 | "Add a plugin to be run (can be used multiple times)"); |
| 1480 | clnopt_witharg("--plugin-dir", OPT_MULTI|OPT_EARLY, |
| 1481 | opt_add_plugin_dir, |
| 1482 | NULL, ld, |
| 1483 | "Add a directory to load plugins from (can be used multiple times)"); |
| 1484 | opt_register_early_noarg("--clear-plugins", opt_clear_plugins, |
| 1485 | ld, |
| 1486 | "Remove all plugins added before this option"); |
| 1487 | clnopt_witharg("--disable-plugin", OPT_MULTI|OPT_EARLY, |
| 1488 | opt_disable_plugin, |
| 1489 | NULL, ld, |
| 1490 | "Disable a particular plugin by filename/name"); |
| 1491 | |
| 1492 | clnopt_witharg("--important-plugin", OPT_MULTI|OPT_EARLY, |
| 1493 | opt_important_plugin, |
| 1494 | NULL, ld, |
| 1495 | "Add an important plugin to be run (can be used multiple times). Die if the plugin dies."); |
| 1496 | |
| 1497 | /* Early, as it suppresses DNS lookups from cmdline too. */ |
| 1498 | clnopt_witharg("--always-use-proxy", OPT_EARLY|OPT_SHOWBOOL, |
| 1499 | opt_set_bool_arg, opt_show_bool, |
| 1500 | &ld->always_use_proxy, "Use the proxy always"); |
| 1501 | |
| 1502 | /* This immediately makes is a daemon. */ |
| 1503 | opt_register_early_noarg("--daemon", opt_start_daemon, ld, |
| 1504 | "Run in the background, suppress stdout/stderr"); |
| 1505 | /* DSN can contain a database password */ |
| 1506 | clnopt_witharg("--wallet", OPT_EARLY|OPT_CONCEAL, |
| 1507 | opt_set_talstr, NULL, |
| 1508 | &ld->wallet_dsn, |
| 1509 | "Location of the wallet database."); |
| 1510 | |
| 1511 | clnopt_witharg("--recover", OPT_EARLY|OPT_CONCEAL, |
| 1512 | opt_set_hsm_secret, NULL, |
| 1513 | ld, |
| 1514 | "Populate hsm_secret with the given codex32/hex/mnemonic secret" |
| 1515 | " and starts the node in `offline` mode."); |
| 1516 | clnopt_witharg("--recover-fd", OPT_EARLY|OPT_CONCEAL, |
| 1517 | opt_set_recover_fd, NULL, ld, opt_hidden); |
| 1518 | |
| 1519 | /* This affects our features, so set early. */ |
no test coverage detected