Skip to content

Commit ce95368

Browse files
sveneberthclaude
andauthored
feat: Improve script configure UX with hint and confirmation output (#218)
Show usage hint when no options are passed; print each changed key/value after saving. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 8cdd4c1 commit ce95368

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

src/viur_cli/scriptor/cli.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,37 @@ def script():
3636

3737

3838
@script.command()
39-
@click.option('--url', default=None, help='Set the url')
39+
@click.option('--url', default=None, help='Set the server url')
4040
@click.option('--username', default=None, help='Set the username')
4141
@click.option('--working_dir', default=None, help='Set the working directory where scripts are stored to')
4242
def configure(url: str, username: str, working_dir: str):
4343
"""
4444
Manage configuration settings.
4545
"""
46+
if not any([url, username, working_dir]):
47+
click.echo("No parameters provided. Use one or more of the following options:")
48+
click.echo(" --url Set the server URL")
49+
click.echo(" --username Set the username")
50+
click.echo(" --working_dir Set the working directory where scripts are stored to")
51+
return
52+
53+
changed = []
4654

4755
if url:
4856
scriptor_config["base_url"] = url
57+
changed.append(f"url = {url}")
4958

5059
if username:
5160
scriptor_config["username"] = username
61+
changed.append(f"username = {username}")
5262

5363
if working_dir:
5464
scriptor_config["working_dir"] = working_dir.replace("\\", "/")
65+
changed.append(f"working_dir = {working_dir}")
66+
67+
click.echo("Configuration updated:")
68+
for entry in changed:
69+
click.echo(f" {entry}")
5570

5671
scriptor_config.save()
5772

0 commit comments

Comments
 (0)