Index: python/lib/aubio/cut.py
===================================================================
--- python/lib/aubio/cut.py	(revision 8dd5d4036454b2e7226a05b3e8c8a4ca0b5713fb)
+++ python/lib/aubio/cut.py	(revision c81c3d24e8cb365934542406871ad0e64935ac0f)
@@ -6,12 +6,9 @@
 
 import sys
-import argparse
+from aubio.cmd import AubioArgumentParser
 
 def aubio_cut_parser():
-    parser = argparse.ArgumentParser()
-    parser.add_argument("source_file", default=None, nargs='?',
-            help="input sound file to analyse", metavar = "<source_file>")
-    parser.add_argument("-i", "--input", action = "store", dest = "source_file2",
-            help="input sound file to analyse", metavar = "<source_file>")
+    parser = AubioArgumentParser()
+    parser.add_input()
     parser.add_argument("-O","--onset-method",
             action="store", dest="onset_method", default='default',
@@ -22,5 +19,5 @@
     parser.add_argument("-b","--beat",
             action="store_true", dest="beat", default=False,
-            help="use beat locations")
+            help="slice at beat locations")
     """
     parser.add_argument("-S","--silencecut",
@@ -33,30 +30,13 @@
             """
     # algorithm parameters
-    parser.add_argument("-r", "--samplerate",
-            metavar = "<freq>", type=int,
-            action="store", dest="samplerate", default=0,
-            help="samplerate at which the file should be represented")
-    parser.add_argument("-B","--bufsize",
-            action="store", dest="bufsize", default=512,
-            metavar = "<size>", type=int,
-            help="buffer size [default=512]")
-    parser.add_argument("-H","--hopsize",
-            metavar = "<size>", type=int,
-            action="store", dest="hopsize", default=256,
-            help="overlap size [default=256]")
-    parser.add_argument("-t","--onset-threshold",
-            metavar = "<value>", type=float,
+    parser.add_buf_hop_size()
+    parser.add_argument("-t","--threshold", "--onset-threshold",
+            metavar = "<threshold>", type=float,
             action="store", dest="threshold", default=0.3,
             help="onset peak picking threshold [default=0.3]")
     parser.add_argument("-c","--cut",
             action="store_true", dest="cut", default=False,
-            help="cut input sound file at detected labels \
-                    best used with option -L")
-
-    # minioi
-    parser.add_argument("-M","--minioi",
-            metavar = "<value>", type=str,
-            action="store", dest="minioi", default="12ms",
-            help="minimum inter onset interval [default=12ms]")
+            help="cut input sound file at detected labels")
+    parser.add_minioi()
 
     """
@@ -80,7 +60,5 @@
             action="store", dest="zerothres", default=0.008,
             help="zero-crossing threshold for slicing [default=0.00008]")
-            """
     # plotting functions
-    """
     parser.add_argument("-p","--plot",
             action="store_true", dest="plot", default=False,
@@ -108,41 +86,19 @@
             help="add spectrogram to the plot")
     """
-    parser.add_argument("-o","--output", type = str,
-            metavar = "<outputdir>",
-            action="store", dest="output_directory", default=None,
-            help="specify path where slices of the original file should be created")
-    parser.add_argument("--cut-until-nsamples", type = int,
-            metavar = "<samples>",
-            action = "store", dest = "cut_until_nsamples", default = None,
-            help="how many extra samples should be added at the end of each slice")
-    parser.add_argument("--cut-every-nslices", type = int,
-            metavar = "<samples>",
-            action = "store", dest = "cut_every_nslices", default = None,
-            help="how many slices should be groupped together at each cut")
-    parser.add_argument("--cut-until-nslices", type = int,
-            metavar = "<slices>",
-            action = "store", dest = "cut_until_nslices", default = None,
-            help="how many extra slices should be added at the end of each slice")
-
-    parser.add_argument("-v","--verbose",
-            action="store_true", dest="verbose", default=True,
-            help="make lots of noise [default]")
-    parser.add_argument("-q","--quiet",
-            action="store_false", dest="verbose", default=True,
-            help="be quiet")
+    parser.add_slicer_options()
+    parser.add_verbose_help()
     return parser
 
 
 def _cut_analyze(options):
-    source_file = options.source_file
-    hopsize = options.hopsize
-    bufsize = options.bufsize
+    hopsize = options.hop_size
+    bufsize = options.buf_size
     samplerate = options.samplerate
-    source_file = options.source_file
+    source_uri = options.source_uri
 
     # analyze pass
     from aubio import onset, tempo, source
 
-    s = source(source_file, samplerate, hopsize)
+    s = source(source_uri, samplerate, hopsize)
     if samplerate == 0:
         samplerate = s.get_samplerate()
@@ -192,5 +148,5 @@
             timestamps_end = [t for t in timestamps[1 + options.cut_until_nslices:]]
             timestamps_end += [ 1e120 ] * (options.cut_until_nslices + 1)
-        slice_source_at_stamps(options.source_file,
+        slice_source_at_stamps(options.source_uri,
                 timestamps, timestamps_end = timestamps_end,
                 output_dir = options.output_directory,
@@ -200,10 +156,10 @@
     parser = aubio_cut_parser()
     options = parser.parse_args()
-    if not options.source_file and not options.source_file2:
+    if not options.source_uri and not options.source_uri2:
         sys.stderr.write("Error: no file name given\n")
         parser.print_help()
         sys.exit(1)
-    elif options.source_file2 is not None:
-        options.source_file = options.source_file2
+    elif options.source_uri2 is not None:
+        options.source_uri = options.source_uri2
 
     # analysis
@@ -212,5 +168,5 @@
     # print some info
     duration = float (total_frames) / float(options.samplerate)
-    base_info = '%(source_file)s' % {'source_file': options.source_file}
+    base_info = '%(source_uri)s' % {'source_uri': options.source_uri}
     base_info += ' (total %(duration).2fs at %(samplerate)dHz)\n' % \
             {'duration': duration, 'samplerate': options.samplerate}
