--- burncd.old +++ burncd @@ -215,13 +215,13 @@ #}}} # Global variables {{{ -PROG = "burn-cd" +PROG = "burncd" VERSION = \ "%s version 1.7.3\n" \ "Written by SmART, 2004-2007" % PROG -USAGE = "Usage: %s [options] [...]\n" % PROG +USAGE = "Usage: %s [options] [...]\n" % PROG DESCRIPTION = \ "This is a handy console frontend for the cdrtools/cdrkit and the dvd+rw-tools.\n" \ @@ -230,15 +230,16 @@ HELP = \ """Options: - -r, --root= destination dir on the CD (defaults to '/') - -d, --device= CD-RW device (defaults to '/dev/hdc') - -s, --speed= tell cdrecord to burn CD on specific speed - -c, --charset= charset of the filenames (defaults to LOCALE) - --umount= umount command template (defaults to pumount {device}) - -m, --image= burn FILE as a disk image (ex. iso, bin, ...) + -rDIR, --root=DIR destination dir on the CD (defaults to '/') + -dDEV, --device=DEV CD-RW device (defaults to '/dev/hdc') + -sNUM, --speed=NUM tell cdrecord to burn CD at a specific speed + -cXYZ, --charset=XYZ charset of the filenames (defaults to LOCALE) + --umount=umount_command umount command template (defaults to pumount {device}) + -mFILE, --image=FILE burn FILE as a disk image (ex. iso, bin, ...) + --iso=FILE same as --image=FILE --video burn DIR or FILES as a DVD-Video - -z, --zero blank RW-media before burning (only if needed) - --nero try to continue rotten multisession recording + -z, --zero blank RW-media before burning (only if needed) + --nero try to continue bad multisession recording -i, --info show drive/media info and exit -n, --no-color disable colors @@ -253,7 +254,7 @@ /etc/burn-cd.conf $HOME/.burn-cd.conf - place there any of these: + place any of these there: device = /dev/hdc # /dev/hdc | /dev/sr0 | ... cd-speed = auto # auto | 8 | 16 | 24 | ... dvd-speed = auto # auto | 2 | 4 | 8 | ... @@ -262,6 +263,26 @@ interactive = auto # auto | yes | no umount = pumount {device} # pumount {device} | gnome-umount {device} | ... """ + +SHORTHELP = \ +"""Most important options: + -r/PATH or --root=/PATH Target dir on the CD (default is '/') + -dDEV or --device=DEV Set CD or DVD device (default is /dev/hdc) + -sNUM or --speed=NUM Burn at specified speed + -mFILE or --image=FILE Burn FILE as a disk image (e.g., an ISO) + --iso=FILE Same as --image=FILE + -h or --help List more options + -i or --info Show drive/media info and exit + -n or --no-color Disable colors + -v or --verbose Add verbose status messages + -z or --zero Blank RW-media if necessary + --interactive=auto,yes,no Enable or disable RW-blanking prompt + --debug Add debugging messages + --version Show program version and exit + +For configuration-file information, try the --help option. +""" + COLOR_0 = "\033[m" # серый COLOR_1 = "\033[1m" # жирный (bold) COLOR_2 = "\033[0;32m" # зелёный @@ -719,11 +740,11 @@ sys.argv[1:], 'vnr:d:hc:is:zm:', [ 'help', 'verbose', 'no-color', 'root=', 'device=', 'speed=', 'charset=', 'version', 'info', 'debug', 'umount=', - 'zero', 'nero', 'image=', 'video', 'interactive=' ] + 'zero', 'nero', 'image=', 'video', 'interactive=', 'iso=' ] ) except getopt.GetoptError: print - print_error('Error: wrong arguments') + print_error('Error: Invalid arguments') print print USAGE print DESCRIPTION @@ -747,7 +768,7 @@ no_color() elif opt in ['-r','--root']: root = val - elif opt in ['-d','--device']: + elif opt in ['-d','--dev','--device']: device = val elif opt == '--interactive': val = val.lower() @@ -766,7 +787,7 @@ zero = True elif opt in ['--nero']: nero = True - elif opt in ['-m','--image']: + elif opt in ['-m','--image','--iso']: image = val elif opt in ['-c','--charset']: charset = val @@ -778,11 +799,8 @@ if not filenames and not (info or zero or image): print - print_error('Error: you should specify files and/or dirs to burn') - print print USAGE - print DESCRIPTION - print HELP + print SHORTHELP sys.exit(2) root = '/' + escape_str( root ).lstrip('/')