simple_command 0.1.2

Simple command runner for build.rs
Documentation
  • Coverage
  • 33.33%
    1 out of 3 items documented0 out of 1 items with examples
  • Size
  • Source code size: 6.22 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.06 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • rukai/simple_command
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • rukai

When writing a build.rs to run some commands you naturally want to see the output of these commands. This is however impossible because build.rs cannot display stdout or stderr. The next best option is to display the output when the command goes wrong for any reason. The simple_command function does exactly that, panicking if anything at all goes wrong and displaying the combined stderr and stdout.

Possible reasons for panicking include:

  • No command specified
  • Command does not exist
  • Non-zero return value

DO NOT use this function in your actual application, you should be properly handling error cases!