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

chezmoi: invalid value using chezmoi add --secrets ignore #4104

Open
aarondill opened this issue Nov 25, 2024 · 3 comments
Open

chezmoi: invalid value using chezmoi add --secrets ignore #4104

aarondill opened this issue Nov 25, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@aarondill
Copy link
Contributor

aarondill commented Nov 25, 2024

Describe the bug

Chezmoi doesn't seem to recognize the --secrets flag's values anymore.

To reproduce

> chezmoi add --secrets ignore some-file
chezmoi: invalid value

Expected behavior

Add the file while ignoring secrets (like it used to)

Output of chezmoi doctor

$ chezmoi doctor
RESULT    CHECK                       MESSAGE
ok        version                     v2.54.0, commit 92f8a9854bc9a234b937dab2f7d75764efdc0e80, built at 2024-11-09T19:56:50Z, built by goreleaser
ok        latest-version              v2.54.0
ok        os-arch                     linux/amd64 (Arch Linux)
ok        uname                       Linux aaron-arch-HP 6.11.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Sun, 17 Nov 2024 16:06:17 +0000 x86_64 GNU/Linux
ok        go-version                  go1.23.3 (gc)
ok        executable                  /usr/local/bin/chezmoi
ok        upgrade-method              sudo-upgrade-package
ok        config-file                 ~/.config/chezmoi/chezmoi.toml, last modified 2024-11-25T05:16:47-06:00
ok        source-dir                  ~/.local/share/chezmoi is a git working tree (clean)
ok        suspicious-entries          no suspicious entries
ok        working-tree                ~/.local/share/chezmoi is a git working tree (clean)
ok        dest-dir                    ~ is a directory
ok        umask                       002
ok        cd-command                  found /usr/bin/bash
ok        cd-args                     /usr/bin/bash
info      diff-command                not set
ok        edit-command                found ~/.local/bin/nvim
ok        edit-args                   ~/.local/bin/nvim
ok        git-command                 found /usr/bin/git, version 2.47.0
warning   merge-command               vimdiff not found in $PATH
ok        shell-command               found /usr/bin/bash
ok        shell-args                  /usr/bin/bash
ok        age-command                 found /usr/bin/age, version 1.2.0
ok        gpg-command                 found /usr/bin/gpg, version 2.4.6
info      pinentry-command            not set
info      1password-command           op not found in $PATH
ok        bitwarden-command           found /usr/local/bin/bw, version 2024.4.1
info      bitwarden-secrets-command   bws not found in $PATH
info      dashlane-command            dcli not found in $PATH
info      doppler-command             doppler not found in $PATH
info      gopass-command              gopass not found in $PATH
info      keepassxc-command           keepassxc-cli not found in $PATH
info      keepassxc-db                not set
info      keeper-command              keeper not found in $PATH
info      lastpass-command            lpass not found in $PATH
info      pass-command                pass not found in $PATH
info      passhole-command            ph not found in $PATH
info      rbw-command                 rbw not found in $PATH
info      vault-command               vault not found in $PATH
info      vlt-command                 vlt not found in $PATH
info      secret-command              not set

Additional context

Note: using unsupported values gives a different error:

> chezmoi add --verbose --secrets random file
chezmoi: invalid argument "random" for "--secrets" flag: invalid value
@twpayne
Copy link
Owner

twpayne commented Nov 25, 2024

To reproduce

> chezmoi add --secrets ignore some-file
chezmoi: invalid value

I'm unable to reproduce this. For me, the --secrets flag works as expected. For example --secrets ignore is parsed correctly and --secrets random gives the "invalid value" error as it should.

Could you give exact steps for someone else to reproduce the problem?

@twpayne twpayne added the investigating This is a bit weird, not sure if this is a bug yet label Nov 25, 2024
@aarondill
Copy link
Contributor Author

aarondill commented Nov 25, 2024

i've found the issue.
Apparently my config contains

[add]
secrets = "error"

On v2.53.1, this didn't cause an issue and acted as a default if no argument was given. Now, if a command line argument is given, it errors no matter what.

@twpayne
Copy link
Owner

twpayne commented Nov 25, 2024

Ah, thanks! I changed the way that flags with options are handled recently.

@twpayne twpayne added bug Something isn't working and removed investigating This is a bit weird, not sure if this is a bug yet labels Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants