Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CLI apps. For fun and profit

CLI apps. For fun and profit

Talk given at Cocoa Kucha on #inspect conference, May 2014

1a8210be06c7e4e4add04eb95ea7964c?s=128

Marin Usalj

May 29, 2014
Tweet

More Decks by Marin Usalj

Other Decks in Programming

Transcript

  1. CLI APPS. FOR FUN AND PROFIT @SUPERMARIN

  2. WHEN FUNCTIONALITY NOT SUPPORTED BY GUI IT'S HARD TO AUTOMATE

    TASKS ENDLESS POSSIBILITIES
  3. HOW DO I RUBY, GO, PYTHON, EVEN OBJECTIVE-C

  4. PIPELINE CAT BUILD.LOG | GREP ERROR | WC -L

  5. STATUS CODES $ XCODEBUILD | TEE XCODEBUILD.LOG | XCPRETTY

  6. XCODEBUILD FAILS, STATUS 0

  7. PIPESTATUS [] $ xcodebuild | tee output.log | xcpretty $?

    => 0 ${PIPESTATUS[0]} => 65 ${PIPESTATUS[2]} => 0 $ xcodebuild | tee output.log | xcpretty; exit ${PIPESTATUS[0]}
  8. SET -O PIPEFAIL $ xcodebuild | tee output.log | xcpretty

    $ echo $? => 65
  9. BEWARE OF YOUR $SHELL | $SHELL | Exit status |

    Pipe status | Set a var | |--------|-------------|---------------|-------------| | bash | $? | $PIPESTATUS | export VAR= | |--------|-------------|---------------|-------------| | zsh | $status | $pipestatus | export VAR= | |--------|-------------|---------------|-------------| | fish | $status | / | set -x VAR |
  10. #! #!/USR/BIN/ENV RUBY

  11. POSIX FLAGS $ COMMAND --VERBOSE --COLOR = $ COMMAND -VC

    (ONLY IN SILICON VALLEY)
  12. CLI FRAMEWORKS DON'T DIY

  13. XCPRETTY GITHUB.COM/SUPERMARIN/XCPRETTY

  14. SUCH HTML

  15. WHY IN THE WORLD? THERE'S XCTOOL

  16. XCTOOL(XCODEBUILD) -FLAG -FLAG WRAPPING XCODEBUILD, RECREATING FLAGS

  17. XCODEBUILD -FLAG -FLAG | XCPRETTY USING VANILLA XCODEBUILD

  18. XCTOOL - TESTS maintaining separate settings XCODEBUILD - BETA XCODEBUILD

    - APPSTORE maintaining separate settings
  19. USED BY RUBYMOTION FACEBOOK (POP) AFNETWORKING KIWI YAMMER THOUGHTBOT MANY

    OTHERS
  20. <3 HIPBYTE YAMMER @KATTRALI