def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("-p", "--profile",
                        help=_("Choose a profile to start with."),
                        default="default")
    parser.add_argument("-m", "--module",
                        help=_("Start the wizard of a module manually, skipping "
                               "the framework wizard."))
    args = parser.parse_args()

    data = DataModel(args.profile)
    data.load_config()

    if args.module:
        mid, iid = data.split_cid(args.module)
        if callable(data.modules[mid].wizard):
            data.modules[mid].wizard(data.profile, iid)
            return
        else:
            print(_("{module_id} did not register any wizard "
                    "program to start with.").format(module_id=args.module))
            exit(1)

    prerequisite_check()

    print_wrapped(_("Welcome to EH Forwarder Bot Setup Wizard.  This program "
                    "will guide you to finish up the last few steps to "
                    "get EFB ready to use.\n"
                    "\n"
                    "To use this wizard in another supported language, "
                    "please change your system language or modify the "
                    "language environment variable and restart the wizard."))

    print()

    data.profile = input(_("Profile") + f": [{data.profile}] ") or data.profile
    print()

    choose_master_channel(data)
    choose_slave_channels(data)
    choose_middlewares(data)
    confirmation(data)

    print_wrapped(_("Some more advanced settings, such as granulated log control, "
                    "are not included in this wizard.  For further details, you may want to "
                    "refer to the documentation.\n\n"
                    "https://ehforwarderbot.readthedocs.io/en/latest/config.html"))
    print()

    modules_count = 1
    missing_wizards = []
    if not data.has_wizard(data.config['master_channel']):
        missing_wizards.append(data.config['master_channel'])
    for i in data.config['slave_channels']:
        modules_count += 1
        if not data.has_wizard(i):
            missing_wizards.append(i)
    for i in data.config['middlewares']:
        modules_count += 1
        if not data.has_wizard(i):
            missing_wizards.append(i)

    if missing_wizards:
        prompt = ngettext("Note:\n"
                          "The following module does not have a setup wizard. It is probably because "
                          "that it does not need to be set up, or it requires you to set up manually.\n"
                          "Please consult its documentation for further details.\n",
                          "Note:\n"
                          "The following modules do not have a setup wizard. It is probably because "
                          "that they do not need to be set up, or they require you to set up manually.\n"
                          "Please consult their documentations respectively for further details.\n",
                          len(missing_wizards))
        print_wrapped(prompt)
        print()

        for i in missing_wizards:
            print_wrapped("- " + data.get_instance_display_name(i) + " (" + i + ")")

        print()

        if len(missing_wizards) == modules_count:
            print_wrapped(_("Congratulations! You have finished setting up EFB "
                            "framework for the chosen profile. "
                            "You may now continue to configure modules you have "
                            "enabled manually, if necessary."))
            exit(0)
        else:
            print_wrapped(_("We will now guide you to set up some modules you "
                            "have enabled. "
                            "But you may still need to configure other modules "
                            "manually if necessary."))
    else:
        print_wrapped("We will now guide you to set up modules you have enabled, "
                      "each at a time.")

    modules = [data.config['master_channel']]
    modules.extend(data.config['slave_channels'])
    if 'middlewares' in data.config:
        modules.extend(data.config['middlewares'])
    for i in modules:
        mid, iid = data.split_cid(i)
        if mid in data.modules and callable(data.modules[mid].wizard):
            print(_("Press ENTER/RETURN to start setting up {0}.").format(i))
            input()
            data.modules[mid].wizard(data.profile, iid)

    print()
    print_wrapped(_("Congratulations! You have now finished all wizard-enabled "
                    "modules. If you did not configure some modules enabled, "
                    "you might need to configure them manually."))