Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace docopt with structopt #22

Merged
merged 5 commits into from
Aug 8, 2020
Merged

Conversation

garasubo
Copy link
Contributor

@garasubo garasubo commented Jul 3, 2020

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
Copy link
Owner

greymd commented Jul 4, 2020

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

@garasubo garasubo changed the title WIP: Replace docopt with structopt Replace docopt with structopt Jul 5, 2020
@garasubo
Copy link
Contributor Author

garasubo commented Jul 5, 2020

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

@garasubo
Copy link
Contributor Author

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

@greymd
Copy link
Owner

greymd commented Aug 8, 2020

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

@greymd greymd merged commit b0e98f1 into greymd:master Aug 8, 2020
@garasubo
Copy link
Contributor Author

garasubo commented Aug 9, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace docopt with clap or structopt?
2 participants