-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Hi,
I'm trying to use the dctap init command to initialize a config. I got the following error:
TypeError: init() missing 1 required positional argument: 'hidden'
I'm using click 8.1.8 (installed by dctap via pip install dctap)
$ pip show click
Name: click
Version: 8.1.8
Summary: Composable command line interface toolkit
Home-page:
Author:
Author-email:
License:
Location: /home/yux/.local/python-3.13.1/lib/python3.13/site-packages
Requires:
Required-by: dctap
There might be two issues in the init() function:
@cli.command()
@click.help_option(help="Show help and exit")
@click.pass_context
def init(context, hidden):
"""Write config file: 'dctap.yaml'."""
configfile = CONFIGFILE
write_configfile(configfile)
- the
hiddenparameter is not used - the call to write_configfile() does not match its sigature:
def write_configfile(
nondefault_configyaml_str=None,
default_configfile_name=CONFIGFILE,
default_configyaml_str=CONFIGYAML,
):
So a fix to init() might be:
@cli.command()
@click.help_option(help="Show help and exit")
@click.pass_context
def init(context):
"""Write config file: 'dctap.yaml'."""
configfile = CONFIGFILE
write_configfile(default_configfile_name=configfile)
Metadata
Metadata
Assignees
Labels
No labels