Skip to content

Commit

Permalink
Can't use CLI parameters named args because of Django.
Browse files Browse the repository at this point in the history
  • Loading branch information
ewjoachim committed Jul 24, 2024
1 parent e94b4d0 commit 4e7ad45
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions procrastinate/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ def configure_shell_parser(subparsers: argparse._SubParsersAction):
)
add_argument(
shell_parser,
"args",
"shell_command",
nargs="*",
help="Invoke a shell command and exit",
)
Expand Down Expand Up @@ -644,16 +644,16 @@ async def healthchecks(app: procrastinate.App):
print("Found procrastinate_jobs table: OK")


async def shell_(app: procrastinate.App, args: list[str]):
async def shell_(app: procrastinate.App, shell_command: list[str]):
"""
Administration shell for procrastinate.
"""
shell_obj = shell.ProcrastinateShell(
job_manager=app.job_manager,
)

if args:
await utils.sync_to_async(shell_obj.onecmd, line=shlex.join(args))
if shell_command:
await utils.sync_to_async(shell_obj.onecmd, line=shlex.join(shell_command))
else:
await utils.sync_to_async(shell_obj.cmdloop)

Expand Down

0 comments on commit 4e7ad45

Please sign in to comment.