Skip to content

nl: don't exit if input is directory #5806

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 1 commit into from
Jan 14, 2024

Conversation

cakebaker
Copy link
Contributor

When specifying a directory instead of a file, GNU nl shows an error but keeps printing the output of the next file(s):

$ nl dir file
nl: dir: Is a directory
     1  content

uutils nl, on the other hand, shows an error and exits:

$ cargo run nl dir file
nl: could not read line: Is a directory

This PR makes uutils nl skip directories and show the same error as GNU nl.

@sylvestre sylvestre merged commit ef03a46 into uutils:main Jan 14, 2024
@cakebaker cakebaker deleted the nl_is_a_directory branch January 15, 2024 06:02
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