Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
erhhung opened this issue Feb 13, 2024 · 1 comment · Fixed by #473
Closed
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@erhhung
Copy link

erhhung commented Feb 13, 2024

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):
@erhhung erhhung changed the title harlequin --config should not prompt for config file name if --config-path is specified harlequin --config should not prompt for config file if --config-path is specified Feb 13, 2024
@tconbeer tconbeer added enhancement New feature or request good first issue Good for newcomers labels Feb 13, 2024
@tconbeer
Copy link
Owner

tconbeer commented Feb 20, 2024

Thanks for this issue. I just learned about $XDG_CONFIG_HOME and the related standard. I'll make the updates to use that standard (see #471 ). I'll keep this issue for the specific enhancement of passing --config-dir to the --config option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants