Skip to content

harlequin --config should not prompt for config file if --config-path is specified #466

Closed
@erhhung

Description

Describe the bug

If I explicitly specify an existing config file to update using the --config-path option while also specifying --config to perform a guided configuration, Harlequin should not prompt me for the config file name—it should just print the --config-path value after confirming that it exists and can be read.

Also, if I run harlequin --config without --config-path, then it should look for an existing config file in the standard search paths and display that as the default response to the first prompt (user can still change it). If no existing config file exists in the search paths, then show .harlequin.toml as the default.

Standard config file search paths should be in this order:

  • ./.harlequin.toml (current directory)
  • $XDG_CONFIG_HOME/harlequin/config.toml (could also be named "harlequin.toml")
  • ~/.config/harlequin/config.toml (could also be named "harlequin.toml")
  • ~/.harlequin.toml (current standard)

To Reproduce

$ harlequin --config --config-path $XDG_CONFIG_HOME/harlequin/config.toml
? What config file do you want to create or update? .harlequin.toml

Actual behavior

harlequin --config forces me, in its first prompt, to enter the full path to the config file I want to update, despite I having already specified that path in --config-path so that I can leverage my shell's glob expansion and variable substitution capabilities (e.g. ~/ and $XDG_CONFIG_HOME).

Additional context

$ harlequin --version
harlequin, version 1.15.0

Installed Adapters:
  - duckdb, version 1.15.0
  - sqlite, version 1.15.0
  - postgres, version 0.2.2

Can you tell us more about your system?

  • Shell: Bash 5.2.26(1)-release
  • Terminal: iTerm2 3.4.23
  • OS of the shell: macOS 14.2.1
  • OS of the terminal (if different from the shell):

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions