Skip to content

Commit

Permalink
Resolves #850.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjordan committed Nov 15, 2024
1 parent 01b77bc commit f86d56d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions workbench
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import collections
import subprocess
import requests_cache
from progress_bar import InitBar
from rich.console import Console
from rich.table import Table
from ruamel.yaml import YAML
from workbench_utils import *
import workbench_fields
Expand Down Expand Up @@ -3467,6 +3469,11 @@ parser.add_argument(
parser.add_argument(
"--contactsheet", help="Generate a contact sheet.", action="store_true"
)
parser.add_argument(
"--print_config",
help="Prints out the current configuration settings.",
action="store_true",
)
parser.add_argument(
"--skip_user_prompts",
help='Include to skip any user prompts defined in your config file\'s "user_prompts" setting.',
Expand All @@ -3491,6 +3498,21 @@ except Exception as e:
sys.exit(str(e))
config = workbench_config.get_config()

if args.print_config is True:
print("\nCurrent Islandora Workbench configuration, including defaults")
table = Table()
table.add_column("Config setting", justify="left")
table.add_column("Value", justify="left")
for key, value in config.items():
if key == "password":
table.add_row(key, "xxxxxxxxxx")
else:
table.add_row(key, str(value))

console = Console()
console.print(table)
sys.exit()

if args.check is not True and config["remind_user_to_run_check"] is True:
if args.skip_user_prompts is not True:
user_has_run_check = input("Have you run --check? (y/n)")
Expand Down

0 comments on commit f86d56d

Please sign in to comment.