pandorabots / pb-cli

Pandorabots command line interface
BSD 2-Clause "Simplified" License
33 stars 16 forks source link

Validation needed for delete and remove commands #2

Closed djfdev closed 9 years ago

djfdev commented 9 years ago

Need to implement some sort of validation when any DELETE like command is run. Example:

$ pb delete
Please enter the name of the bot to confirm deletion
$ pb remove foo.aiml
Please re-enter the name of the file to confirm deletion

This will help curb accidental deletions.

pbyk commented 9 years ago

Thank you for your advice! I'll handle it later.

pbyk commented 9 years ago

Both remove and upload methods now prompt to re-enter file name when the file is missing.

pandorabots commented 9 years ago

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

pbyk commented 9 years ago

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.

pandorabots commented 9 years ago

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.

djfdev commented 9 years ago

Resolved in latest release (1.0.0).