Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions redbot/core/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,15 @@ def parse_cli_flags(args):
action="extend",
help="Force unloading specified cogs.",
)
parser.add_argument(
"--cog-path",
type=str,
default=[],
nargs="+",
action="extend",
help="Add a specific path to the list of cog paths. "
"This can be used multiple times to add multiple paths.",
)
parser.add_argument(
"--dry-run",
action="store_true",
Expand Down
9 changes: 9 additions & 0 deletions redbot/core/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1240,6 +1240,15 @@ async def _pre_connect(self) -> None:
)
)

if self._cli_flags.cog_path:
for path in self._cli_flags.cog_path:
path = Path(path)
if not path.exists():
log.warning("Cog path '%s' does not exist, skipping", path)
continue
await self._cog_mgr.add_path(path)
log.info("Added cog path: %s", path)

if packages:
# Load permissions first, for security reasons
try:
Expand Down
Loading