# line_grub line_grub is a teeny command line tool that was created to ease the pain of dealing with _unfortunately_ long strings. Wherever they are. Ones like these: ```txt A neutron star is the collapsed core of a massive supergiant star, which had a total mass of between 10 and 25 solar masses, possibly more if the star was especially metal-rich. Neutron stars are the smallest and densest stellar objects, excluding black holes and hypothetical white holes, quark stars, and strange stars.[2] Neutron stars have a radius on the order of 10 kilometres (6.2 mi) and a mass of about 1.4 solar masses. They result from the supernova explosion of a massive star, combined with gravitational collapse, that compresses the core past white dwarf star density to that of atomic nuclei. ``` _Oof..._ ## An Explanation It's super simple. Install it to your path, enter the command below and... ```bash line_grub long_string_file.txt output.txt ``` You get this: ```txt A neutron star is the collapsed core of a massive supergiant star, which had a total mass of between 10 and 25 solar masses, possibly more if the star was especially metal-rich. Neutron stars are the smallest and densest stellar objects, excluding black holes and hypothetical white holes, quark stars, and strange stars.[2] Neutron stars have a radius on the order of 10 kilometres (6.2 mi) and a mass of about 1.4 solar masses. They result from the supernova explosion of a massive star, combined with gravitational collapse, that compresses the core past white dwarf star density to that of atomic nuclei. ``` _A little bit better right?_ If you want to add a 4 space tab at any location in your string just add "\\" at any point in the string. For example: ```txt \A neutron star is the collapsed core of a massive supergiant star, which had a total mass of between 10 and 25 solar masses, possibly more if the star was especially metal-rich. Neutron stars are the smallest and densest stellar objects, excluding black holes and hypothetical white holes, quark stars, and strange stars.[2] Neutron stars have a radius on the order of 10 kilometres (6.2 mi) and a mass of about 1.4 solar masses. ``` And you get this!: ```txt A neutron star is the collapsed core of a massive supergiant star, which had a total mass of between 10 and 25 solar masses, possibly more if the star was especially metal-rich. Neutron stars are the smallest and densest stellar objects, excluding black holes and hypothetical white holes, quark stars, and strange stars.[2] Neutron stars have a radius on the order of 10 kilometres (6.2 mi) and a mass of about 1.4 solar masses. ``` Most text editors do have great word-wrapping. So in many cases, you'll be fine without this tbh. But for those times when you're purely on the command line, it can come in handy! It's also helpful for debugging. ## Using line_grub [line_grub is available on crates.io](https://crates.io/crates/line_grub). The way to use it is as of now is to get it through Cargo. I will add excutables very soon. ```cargo cargo install line_grub ``` _line_grub currently requires `rustc 1.46.0` or greater._ ## Contribution line_grub is an open source project that is extremely new! Note that all code submitted in PRs to line_grub is assumed to [be licensed under line_grub's dual MIT/Apache2 licensing](https://github.com/idanmuze/line_grub/master/README.md#license). ## License line_grub is distributed under the terms of both the MIT license and the Apache License (Version 2.0). See [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT) for details. Opening a pull request is assumed to signal agreement with these licensing terms.