greymd / teip

Masking tape to help commands "do one thing well"
MIT License
569 stars 19 forks source link

Replace docopt with structopt #22

Closed garasubo closed 4 years ago

garasubo commented 4 years ago

Fix #16

docoptをstructoptをつかって置き換えてみました。 ただし、現状だとヘルプメッセージが以下のように置き換わってしまいます。

teip 1.2.1
Yasuhiro Yamada <yamadagrep@gmail.com>
Allow the command handle selected parts of the standard input, and bypass other parts.

USAGE:
    teip [FLAGS] [OPTIONS] [command]...

FLAGS:
    -h, --help       Prints help information
    -v               Invert the sense of selecting
    -G               -g adopts Oniguruma regular expressions
    -o               -g selects only matched parts
    -s               Execute command for each selected part
    -V, --version    Prints version information
    -z               Line delimiter is NUL instead of newline

OPTIONS:
    -c <char list>                Select only these characters
    -d <delimiter>                Use <delimiter> for field delimiter of -f
    -D <delimiter pattern>        Use regular expression <pattern> for field delimiter of -f
    -l <line list>                Select only these lines
    -f <list>                     Select only these white-space separated fields
    -g <pattern>                  Select lines that match the regular expression <pattern>

ARGS:
    <command>...    
greymd commented 4 years ago

PRありがとうございます!! ヘルプメッセージが置き換わる点については特にこだわりはないので構いません。 WIPとありますが、レビューしてよければ教えて下さいませ。

garasubo commented 4 years ago

了解です! ヘルプメッセージだけどうしようかなと悩んでいたので、これでよいならばちょっとだけ修正すればWIPを外せます!

garasubo commented 4 years ago

@greymd WIP外したので、よろしければレビューお願いします

greymd commented 4 years ago

authorは不要かと思ったのでそこだけ削りました。 ありがとうございました!

garasubo commented 4 years ago

ありがとうございます! structoptを使うとzshやbashの補完も自動でつくる機能があります。うまくいけばCIに組み込んでそのへんも自動化できるかもしれません。