diff options
Diffstat (limited to 'subcmds/gitc_delete.py')
| -rw-r--r-- | subcmds/gitc_delete.py | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/subcmds/gitc_delete.py b/subcmds/gitc_delete.py index df749469..ae9d4d1f 100644 --- a/subcmds/gitc_delete.py +++ b/subcmds/gitc_delete.py | |||
| @@ -19,28 +19,34 @@ import platform_utils | |||
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | class GitcDelete(Command, GitcClientCommand): | 21 | class GitcDelete(Command, GitcClientCommand): |
| 22 | COMMON = True | 22 | COMMON = True |
| 23 | visible_everywhere = False | 23 | visible_everywhere = False |
| 24 | helpSummary = "Delete a GITC Client." | 24 | helpSummary = "Delete a GITC Client." |
| 25 | helpUsage = """ | 25 | helpUsage = """ |
| 26 | %prog | 26 | %prog |
| 27 | """ | 27 | """ |
| 28 | helpDescription = """ | 28 | helpDescription = """ |
| 29 | This subcommand deletes the current GITC client, deleting the GITC manifest | 29 | This subcommand deletes the current GITC client, deleting the GITC manifest |
| 30 | and all locally downloaded sources. | 30 | and all locally downloaded sources. |
| 31 | """ | 31 | """ |
| 32 | 32 | ||
| 33 | def _Options(self, p): | 33 | def _Options(self, p): |
| 34 | p.add_option('-f', '--force', | 34 | p.add_option( |
| 35 | dest='force', action='store_true', | 35 | "-f", |
| 36 | help='force the deletion (no prompt)') | 36 | "--force", |
| 37 | dest="force", | ||
| 38 | action="store_true", | ||
| 39 | help="force the deletion (no prompt)", | ||
| 40 | ) | ||
| 37 | 41 | ||
| 38 | def Execute(self, opt, args): | 42 | def Execute(self, opt, args): |
| 39 | if not opt.force: | 43 | if not opt.force: |
| 40 | prompt = ('This will delete GITC client: %s\nAre you sure? (yes/no) ' % | 44 | prompt = ( |
| 41 | self.gitc_manifest.gitc_client_name) | 45 | "This will delete GITC client: %s\nAre you sure? (yes/no) " |
| 42 | response = input(prompt).lower() | 46 | % self.gitc_manifest.gitc_client_name |
| 43 | if not response == 'yes': | 47 | ) |
| 44 | print('Response was not "yes"\n Exiting...') | 48 | response = input(prompt).lower() |
| 45 | sys.exit(1) | 49 | if not response == "yes": |
| 46 | platform_utils.rmtree(self.gitc_manifest.gitc_client_dir) | 50 | print('Response was not "yes"\n Exiting...') |
| 51 | sys.exit(1) | ||
| 52 | platform_utils.rmtree(self.gitc_manifest.gitc_client_dir) | ||
