o at@s<ddlZddlmZmZddlmZmZGdddeZdS)N) BaseCommand CommandError)DEFAULT_DB_ALIAS connectionsc@s$eZdZdZgZddZddZdS)CommandzaRuns the command-line client for specified database, or the default database if none is provided.cCs0|jdtdd|jddd}|jddddS) Nz --databasezTNominates a database onto which to open a shell. Defaults to the "default" database.)defaulthelp parametersz--) prefix_chars*)nargs) add_argumentradd_argument_group)selfparserr rI/usr/lib/python3/dist-packages/django/core/management/commands/dbshell.py add_argumentss zCommand.add_argumentsc Kszt|d}z |j|dWdSty td|jjtjy<}ztdd|j |j f|j dd}~ww)Ndatabaser z@You appear not to have the %r program installed or on your path.z&"%s" returned non-zero exit status %s. ) returncode) rclientrunshellFileNotFoundErrorrexecutable_name subprocessCalledProcessErrorjoincmdr)roptions connectionerrrhandles&   zCommand.handleN)__name__ __module__ __qualname__rrequires_system_checksrr"rrrrrs  r)rdjango.core.management.baserr django.dbrrrrrrrs