openfaas / faas-cli

Official CLI for OpenFaaS
https://www.openfaas.com/
Other
798 stars 224 forks source link

pkg commands: creates a function newXCmd() in charge of creating a new command #295

Open itscaro opened 6 years ago

itscaro commented 6 years ago

In some test cases, we need to reset flags & args of the command in test. In the actual used technique, creating the command in global scope and initializes its flags & args in init(), we cannot re-create the command to test it from state-zero.

If there is a testing technique for this case, please enlighten me :-)

Attempt to address this issue: https://github.com/openfaas/faas-cli/compare/master...itscaro:refactor-cmd

itscaro commented 6 years ago

Derek add label: proposal