summaryrefslogtreecommitdiff
path: root/mat-cli
diff options
context:
space:
mode:
authorjvoisin2011-08-21 22:18:46 +0200
committerjvoisin2011-08-21 22:18:46 +0200
commitf96246fbd7e78c3dedfebb2e8981398c43a3fcf3 (patch)
tree86124fd07ba00521e87de550b89e43510b007b17 /mat-cli
parent383537fb9f6910d765a022ba7b2ac9bc04abb9a7 (diff)
--help improvements
Diffstat (limited to 'mat-cli')
-rwxr-xr-xmat-cli28
1 files changed, 17 insertions, 11 deletions
diff --git a/mat-cli b/mat-cli
index c0f2d72..6b2de43 100755
--- a/mat-cli
+++ b/mat-cli
@@ -18,23 +18,29 @@ def parse():
18 ''' 18 '''
19 Get, and parse options passed to the program 19 Get, and parse options passed to the program
20 ''' 20 '''
21 parser = optparse.OptionParser(usage='%prog [options] files') 21 parser = optparse.OptionParser(usage='%prog [options] files\n\
22 parser.add_option('--add2archive', '-a', action='store_true', 22The default behaviour is to clean files given in argument')
23 options = optparse.OptionGroup(parser, 'Options')
24 options.add_option('--add2archive', '-a', action='store_true',
23 default=False, help='Add to output archive non-supported filetypes') 25 default=False, help='Add to output archive non-supported filetypes')
24 parser.add_option('--backup', '-b', action='store_true', default=False, 26 options.add_option('--backup', '-b', action='store_true', default=False,
25 help='Keep a backup copy') 27 help='Keep a backup copy')
26 parser.add_option('--check', '-c', action='store_true', default=False, 28 options.add_option('--force', '-f', action='store_true', default=False,
29 help='Don\'t check if files are clean before cleaning')
30 options.add_option('--ugly', '-u', action='store_true', default=False,
31 help='Strict cleaning mode : loss can occur')
32
33 info = optparse.OptionGroup(parser, 'Informations')
34 info.add_option('--check', '-c', action='store_true', default=False,
27 help='Check if a file is free of harmful metadatas') 35 help='Check if a file is free of harmful metadatas')
28 parser.add_option('--display', '-d', action='store_true', default=False, 36 info.add_option('--display', '-d', action='store_true', default=False,
29 help='List all the meta of a file without removing them') 37 help='List all the meta of a file without removing them')
30 parser.add_option('--force', '-f', action='store_true', default=False, 38 info.add_option('--list', '-l', action='store_true', default=False,
31 help='Don\'t check if files are clean before cleaning')
32 parser.add_option('--list', '-l', action='store_true', default=False,
33 help='List all supported fileformat') 39 help='List all supported fileformat')
34 parser.add_option('--ugly', '-u', action='store_true', default=False, 40 info.add_option('--version', '-v', action='callback',
35 help='Remove harmful meta, but loss can occur')
36 parser.add_option('--version', '-v', action='callback',
37 callback=display_version, help='Display version and exit') 41 callback=display_version, help='Display version and exit')
42 parser.add_option_group(options)
43 parser.add_option_group(info)
38 44
39 values, arguments = parser.parse_args() 45 values, arguments = parser.parse_args()
40 if not arguments and values.list is False: 46 if not arguments and values.list is False: