sort-path-length

Crates.iosort-path-length
lib.rssort-path-length
version0.3.1
sourcesrc
created_at2023-02-08 19:07:11.081109
updated_at2023-02-10 00:47:18.870175
descriptionTakes a file of paths and sort them by component length
homepagehttps://reinaldorauch.dev.br/sort-path-length
repositoryhttps://github.com/reinaldorauch/sort-path-length
max_upload_size
id780135
size62,912
Reinaldo Antonio Camargo Rauch (reinaldorauch)

documentation

README

sort-path-length

Binary package to sort paths based on their component's length

Instalation

$ cargo install sort-path-length

Usage

$ sort-path-length <path>

where <path> is a file containing paths separtated by \n (new line).

Or you can pass via pipe in the terminal like so:

$ cat a_file | sort-path-length

If you do not pass a file in the argument or the file name is "-" the program will expect input in the stdin

example input file

/a/absolute/path
/a/b/c/d/e
/a
/a/dpasodj

the output on stdout should be

/a
/a/dpasodj
/a/absolute/path
/a/b/c/d/e

TODO

  • Accept input from stdin (done)
  • Add option to change sort order
  • Check usage on other systems (eg: Windows)
  • Improve documentation
Commit count: 15

cargo fmt