mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
@ -97,38 +97,42 @@ def do_auto_mode(agent):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parser = argparse.ArgumentParser()
|
parent_parser = argparse.ArgumentParser()
|
||||||
parser = plugins_cmd.add_parsers(parser)
|
|
||||||
parser2 = google_cmd.add_parsers(parser)
|
|
||||||
|
|
||||||
parser.add_argument('-C', '--config', action='store', dest='config', default='/etc/pwnagotchi/default.toml',
|
parent_parser.add_argument('-C', '--config', action='store', dest='config', default='/etc/pwnagotchi/default.toml',
|
||||||
help='Main configuration file.')
|
help='Main configuration file.')
|
||||||
parser.add_argument('-U', '--user-config', action='store', dest='user_config', default='/etc/pwnagotchi/config.toml',
|
parent_parser.add_argument('-U', '--user-config', action='store', dest='user_config', default='/etc/pwnagotchi/config.toml',
|
||||||
help='If this file exists, configuration will be merged and this will override default values.')
|
help='If this file exists, configuration will be merged and this will override default values.')
|
||||||
|
|
||||||
parser.add_argument('--manual', dest="do_manual", action="store_true", default=False, help="Manual mode.")
|
parent_parser.add_argument('--manual', dest="do_manual", action="store_true", default=False, help="Manual mode.")
|
||||||
parser.add_argument('--skip-session', dest="skip_session", action="store_true", default=False,
|
parent_parser.add_argument('--skip-session', dest="skip_session", action="store_true", default=False,
|
||||||
help="Skip last session parsing in manual mode.")
|
help="Skip last session parsing in manual mode.")
|
||||||
|
|
||||||
parser.add_argument('--clear', dest="do_clear", action="store_true", default=False,
|
parent_parser.add_argument('--clear', dest="do_clear", action="store_true", default=False,
|
||||||
help="Clear the ePaper display and exit.")
|
help="Clear the ePaper display and exit.")
|
||||||
|
|
||||||
parser.add_argument('--debug', dest="debug", action="store_true", default=False,
|
parent_parser.add_argument('--debug', dest="debug", action="store_true", default=False,
|
||||||
help="Enable debug logs.")
|
help="Enable debug logs.")
|
||||||
|
|
||||||
parser.add_argument('--version', dest="version", action="store_true", default=False,
|
parent_parser.add_argument('--version', dest="version", action="store_true", default=False,
|
||||||
help="Print the version.")
|
help="Print the version.")
|
||||||
|
|
||||||
parser.add_argument('--print-config', dest="print_config", action="store_true", default=False,
|
parent_parser.add_argument('--print-config', dest="print_config", action="store_true", default=False,
|
||||||
help="Print the configuration.")
|
help="Print the configuration.")
|
||||||
|
|
||||||
# Jayofelony added these
|
# Jayofelony added these
|
||||||
parser.add_argument('--check-update', dest="check_update", action="store_true", default=False,
|
parent_parser.add_argument('--check-update', dest="check_update", action="store_true", default=False,
|
||||||
help="Check for updates on Pwnagotchi. And tells current version.")
|
help="Check for updates on Pwnagotchi. And tells current version.")
|
||||||
parser.add_argument('--donate', dest="donate", action="store_true", default=False,
|
parent_parser.add_argument('--donate', dest="donate", action="store_true", default=False,
|
||||||
help="How to donate to this project.")
|
help="How to donate to this project.")
|
||||||
|
|
||||||
args = parser.parse_args()
|
# sub parser plugins
|
||||||
|
parser = parent_parser.add_subparsers(title="actions")
|
||||||
|
parser1 = plugins_cmd.add_parsers(parser)
|
||||||
|
args = parser1.parse_args()
|
||||||
|
|
||||||
|
# sub parser google
|
||||||
|
parser2 = google_cmd.add_parsers(parser)
|
||||||
args2 = parser2.parse_args()
|
args2 = parser2.parse_args()
|
||||||
|
|
||||||
if plugins_cmd.used_plugin_cmd(args):
|
if plugins_cmd.used_plugin_cmd(args):
|
||||||
@ -136,9 +140,6 @@ if __name__ == '__main__':
|
|||||||
log.setup_logging(args, config)
|
log.setup_logging(args, config)
|
||||||
rc = plugins_cmd.handle_cmd(args, config)
|
rc = plugins_cmd.handle_cmd(args, config)
|
||||||
sys.exit(rc)
|
sys.exit(rc)
|
||||||
if google_cmd.used_google_cmd(args2):
|
|
||||||
rc = google_cmd.handle_cmd(args2)
|
|
||||||
sys.exit(rc)
|
|
||||||
|
|
||||||
if args.version:
|
if args.version:
|
||||||
print(pwnagotchi.__version__)
|
print(pwnagotchi.__version__)
|
||||||
|
Reference in New Issue
Block a user