Skip to content

RUSTIC_PASSWORD_COMMAND and --password-command are not working properly #1177

@drdo

Description

@drdo

Neither way works to run a command with arguments.

In either case clap always parses this into a vector of one element with the entire string, which will then fail to run with
error: No such file or directory (os error 2).

For example if you run rustic --password-command "echo foo" clap will set password_command in RepositoryOptions to a value like["echo foo"], rather than the presumably expected ["echo", "foo"].

I didn't test but I expect that warm_up_command has the exact same issue.

I'm happy to take a crack at solving this but I'd like some input.

In my opinion the nicest way from a user perspective would be to parse the string into arguments supporting at least quoting so you can have arguments with spaces in them.

Additional issue:
The error message is very unhelpful for a user.
There is no other information, just the error: No such file or directory (os error 2).
Had to do some chasing around in the code to figure out what it was.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cliArea: `rustic` command line interfaceC-bugCategory: Something isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions