Fix precedence loading of defaults

This commit is contained in:
Luke Murphy 2021-01-16 20:24:03 +01:00
parent c9dec93a4b
commit b8a7c71a0f
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC

View File

@ -164,18 +164,13 @@ class Bot(ClientXMPP):
help="Nickname for the bot account", help="Nickname for the bot account",
) )
self.parser.add_argument( self.parser.add_argument(
"-av", "-av", "--avatar", dest="avatar", help="Avatar for the bot account"
"--avatar",
dest="avatar",
help="Avatar for the bot account",
default="avatar.png",
) )
self.parser.add_argument( self.parser.add_argument(
"-r", "-r",
"--redis-url", "--redis-url",
dest="redis_url", dest="redis_url",
help="Redis storage connection URL", help="Redis storage connection URL",
default="redis://localhost:6379/0",
) )
self.args = self.parser.parse_args() self.args = self.parser.parse_args()
@ -242,6 +237,7 @@ class Bot(ClientXMPP):
self.args.avatar self.args.avatar
or self.config.avatar or self.config.avatar
or environ.get("XBOT_AVATAR", None) or environ.get("XBOT_AVATAR", None)
or "avatar.png"
) )
redis_url = ( redis_url = (
self.args.redis_url self.args.redis_url