Closed djfdev closed 9 years ago
Thank you for your advice! I'll handle it later.
Both remove and upload methods now prompt to re-enter file name when the file is missing.
Include validation to require user to re-enter name of the bot or the filename to confirm deletion as in djfdev's example above. This will help prevent accidental deletions.
example: $ pb delete Please enter the name of the bot to confirm deletion
$pb delete --botname foo Please enter the name of the bot to confirm deletion
Le me confirm what exactly this request means... If it means that pb-cli needs to validate (asking user to input name on tty) whenever user issues delete/remove method, user will be unable to embed "pb delete" into a shell script like ./pb-cli/test/test.sh has already done (see last part). Or, pb-cli need to employ --yes/-y swich to turn off the validations like "apt-get -y". In addition, I think the validation could be simply asking something like "Are you sure: name? (y/n)" because one do not want to input the name twice. Any opinions are welcomed.
Agreed -- a y/n prompt is acceptable (rather than the prompt to enter in botname or filename again) in order to implement a turn-off validation option for test scripts. Also, the prompt for "pb delete" should include the bot name "Are you sure you want to delete bot: [botname]? (y/n)" in the case where it is specified in the chatbot.json file.
Resolved in latest release (1.0.0).
Need to implement some sort of validation when any DELETE like command is run. Example:
This will help curb accidental deletions.