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

shelp - brief introduction

shelp - brief introduction

Open Go Friday #7 で発表した資料です。
https://connpass.com/event/180488/

progrhyme

June 26, 2020
Tweet

More Decks by progrhyme

Other Decks in Technology

Transcript

  1. About Me • @progrhyme • HP: progrhy.me • Career ◦

    〜2017 Oct. @DeNA ◦ 〜2019 Dec. @M3 ◦ 〜Now @MonotaRO • Revisited the tour of Go recently 2
  2. What is "shelp"? • https://github.com/progrhyme/shelp • Git-based package manager for

    shell scripts • Install, update packages by `git` command • Commandline tool • Supports fish shell, Zsh, Bash and more 3
  3. Implementation • spf13/pflag to parse command-line flags • Directory layout:

    ◦ github.com/progrhyme/shelp ... CLI package ▪ internal/ ... All internal packages ◦ Don't suppose to be used as library for now 5
  4. What I struggled with the most • A number of

    "types" to define to implement similar but various "command" and "option" objects ◦ 34 types in "internal/cli" package ◦ There may be better ways • Felt like making boilerplates ... • `gorename` helped me a lot to refine their naming (about 30 times or so) 6