8000 install: better error messages when handling invalid arguments by ndd7xv · Pull Request #3187 · uutils/coreutils · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

install: better error messages when handling invalid arguments #3187

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

Merged
merged 2 commits into from
Feb 26, 2022

Conversation

ndd7xv
Copy link
Contributor
@ndd7xv ndd7xv commented Feb 24, 2022

Addresses #3048 - executing

install

or

install <file>

no longer panics, and instead returns errors similar to GNU's install when it encounters similar arguments.

@sylvestre
Copy link
Contributor
sylvestre commented Feb 24, 2022

I guess you saw:

failures:

---- test_install::test_install_dir stdout ----
current_directory_resolved: 
touch: /tmp/.tmprpBpPO/source_file1
touch: /tmp/.tmprpBpPO/source_file2
mkdir: /tmp/.tmprpBpPO/target_dir
run: /home/runner/work/coreutils/coreutils/target/debug/coreutils install source_file1 source_file2 --target-directory=target_dir
thread 'test_install::test_install_dir' panicked at 'assertion failed: at.file_exists(&format!(\"{}/{}\", dir, file2))', /home/runner/work/coreutils/coreutils/tests/by-util/test_install.rs:691:5


failures:
    test_install::test_install_dir

executing `install` or `install file` no longer panics and insteads returns errors similar to GNU's install when it encounters similar args
copy(&sources[0], &target, b)
copy(
sources.get(0).ok_or_else(|| {
UUsageError::new(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No coverage here, could you please add a test to trigger this error ?
thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about that! Let me know if there's anything else I should do as well :)

@sylvestre sylvestre merged commit 3b48d12 into uutils:main Feb 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0