feat(cli): devbase scale をトップレベルショートカットとして追加#9
Merged
Conversation
devbase container scale だけでなく devbase scale でも同等動作するようにした。 - lib/devbase/cli.py: SHORTCUTS / トップレベルパーサ / プレフィックス展開対象 / ヘルプに scale を追加 - bin/devbase: bash ラッパーの許可コマンド一覧に scale を追加
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.
概要
devbase container scale <N>のショートカットとしてdevbase scale <N>でも同等に動作するようにした。up/down/login/build/psと同様、頻繁に使うコンテナサブコマンドをトップレベルから直接呼び出せるようにする。関連 Issue
変更点
lib/devbase/cli.pySHORTCUTSに'scale': ('container', 'scale')を追加scaleパーサを追加(new_scalepositional 引数を受ける)_expand_argvのプレフィックス展開対象コマンド一覧にscaleを追加--helpの Shortcuts セクションにscaleを表示bin/devbaseresolve_commandのコマンド一覧にscaleを追加scaleを追加して Python 実装へ委譲動作確認
devbase scale --helpがヘルプを表示するdevbase container scale --helpが従来通り動作するdevbase scale <N>で実際にスケール変更が動作する(既存のcmd_scaleを呼ぶだけなので回帰なし想定)補足
dispatch は既存の
SHORTCUTS機構をそのまま利用しており、args.subcommand = 'scale'をセットしてcmd_containerに委譲する。new_scale引数は shortcut パーサ側で定義しているためcmd_scale側の変更は不要。