mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Show error if --setting hash_urls 1 used, refs #1661
This commit is contained in:
parent
d4f60c2388
commit
8658c66438
3 changed files with 35 additions and 8 deletions
|
|
@ -12,7 +12,14 @@ from subprocess import call
|
|||
import sys
|
||||
from runpy import run_module
|
||||
import webbrowser
|
||||
from .app import Datasette, DEFAULT_SETTINGS, SETTINGS, SQLITE_LIMIT_ATTACHED, pm
|
||||
from .app import (
|
||||
OBSOLETE_SETTINGS,
|
||||
Datasette,
|
||||
DEFAULT_SETTINGS,
|
||||
SETTINGS,
|
||||
SQLITE_LIMIT_ATTACHED,
|
||||
pm,
|
||||
)
|
||||
from .utils import (
|
||||
StartupError,
|
||||
check_connection,
|
||||
|
|
@ -50,8 +57,12 @@ class Config(click.ParamType):
|
|||
return
|
||||
name, value = config.split(":", 1)
|
||||
if name not in DEFAULT_SETTINGS:
|
||||
if name in OBSOLETE_SETTINGS:
|
||||
msg = OBSOLETE_SETTINGS[name].help
|
||||
else:
|
||||
msg = f"{name} is not a valid option (--help-settings to see all)"
|
||||
self.fail(
|
||||
f"{name} is not a valid option (--help-settings to see all)",
|
||||
msg,
|
||||
param,
|
||||
ctx,
|
||||
)
|
||||
|
|
@ -83,8 +94,12 @@ class Setting(CompositeParamType):
|
|||
def convert(self, config, param, ctx):
|
||||
name, value = config
|
||||
if name not in DEFAULT_SETTINGS:
|
||||
if name in OBSOLETE_SETTINGS:
|
||||
msg = OBSOLETE_SETTINGS[name].help
|
||||
else:
|
||||
msg = f"{name} is not a valid option (--help-settings to see all)"
|
||||
self.fail(
|
||||
f"{name} is not a valid option (--help-settings to see all)",
|
||||
msg,
|
||||
param,
|
||||
ctx,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue