Skip to content

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

Merged
sylvestre merged 1 commit intouutils:mainfrom
cakebaker:nl_is_a_directory
Jan 14, 2024
Merged

nl: don't exit if input is directory#5806
sylvestre merged 1 commit intouutils:mainfrom
cakebaker:nl_is_a_directory

Conversation

@cakebaker
Copy link
Copy Markdown
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