期間を指定する部分を改善した#7
Open
moba1 wants to merge 1 commit intohinananoha:mainfrom
Open
Conversation
acc8c9c to
b339030
Compare
Owner
同様の理解。これに関しては、現在main関数でCSV出力までしているのを、CSV出力を別関数に分離して、モジュールとして扱いやすくしたい気持ちがあり、そこと併せて実装をしたい。 また、 |
Contributor
Author
|
その場合、おそらく git のようにサブコマンドを用意しておくのがよいのではないだろうか? # 今月分の表示
booth_order_list.py current-month
## エイリアス
booth_order_list.py cu
# 特定期間の表示(`--begin` か `--end` のいずれかを指定するように義務付ける)
booth_order_list.py range --begin YYYY-mm-dd --end YYYY-mm-dd
# 指定なし
booth_order_list.py non-range
## エイリアス
booth_order_list.py nr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
目的
期間指定に
-cと-rという2つのオプションが存在してるのを統一したい詳細
統一するにあたって、
-cと-rを同一に扱えるフォーマットが必要となる。そこで、
-rに JSON を指定できるようにして、これらを切り替えられるようにした。現在は今月を意味する
{"type": "current-month" }とある期間を表す{"type": "period", "begin": "YYYY-mm-dd", "end": "YYYY-mm-dd"}の2つのフォーマットを提供している。つまり、
typeプロパティに指定した種類によって JSON の内容を切り替えることで統一的にかつ柔軟に期間指定ができるようになった。注意事項
これを含んだものをリリースする際は、後方互換性がなくなっているので v2.0.0 にバンプさせる必要がある