diff --git a/riocli/device/delete.py b/riocli/device/delete.py index 1c549b2c..5d765624 100644 --- a/riocli/device/delete.py +++ b/riocli/device/delete.py @@ -39,10 +39,9 @@ @click.option('--force', '-f', '--silent', is_flag=True, default=False, help='Skip confirmation') @click.option('--delete-all', '-a', is_flag=True, default=False, - help='deletes all devices') + help='Delete all devices') @click.option('--workers', '-w', - help="number of parallel workers while running delete devices " - "command. defaults to 10.", type=int, default=10) + help="Number of parallel workers for deleting devices. Defaults to 10.", type=int, default=10) @click.argument('device-name-or-regex', type=str, default="") @with_spinner(text='Deleting device...') def delete_device( @@ -123,13 +122,20 @@ def delete_device( tabulate_data(data, headers=['Name', 'Status']) spinner.write('') - if success_count: + + if failed_count == 0: spinner.text = click.style( - '{0} Devices(s) deleted successfully.'.format(success_count), Colors.GREEN) + 'All Devices(s) deleted successfully.', Colors.GREEN) spinner.ok(click.style(Symbols.SUCCESS, Colors.GREEN)) - if failed_count: + + elif success_count == 0: + spinner.text = click.style( + 'Failed to delete devices', Colors.YELLOW) + spinner.ok(click.style(Symbols.WARNING, Colors.YELLOW)) + + else: spinner.text = click.style( - '{0} Devices(s) deletion failed.'.format(failed_count), Colors.YELLOW) + '{}/{} devices deleted successfully'.format(success_count, success_count+failed_count), Colors.YELLOW) spinner.ok(click.style(Symbols.WARNING, Colors.YELLOW)) except Exception as e: spinner.text = click.style(