@@ -256,7 +256,7 @@ def get_argparse():
256
256
parser .add_argument ('--digits' , type = int , help = "digits in counter (default=4)" , default = 4 )
257
257
258
258
parser .add_argument ('--separator' , type = str , help = "separate components with delimiter (default is '-')" , default = "-" )
259
- parser .add_argument ('--counter' , type = str , help = "counter name" )
259
+ parser .add_argument ('--counter' , type = str , help = "counter name (defaults to --id if present) " )
260
260
parser .add_argument ('--counter-path' , type = str , help = "counter filename/path to filename" , default = ".counter.dat" )
261
261
262
262
parser .add_argument ('--restrict-output-fields' ,
@@ -569,8 +569,16 @@ def main():
569
569
if args .id != None :
570
570
name_components ['id' ] = args .id
571
571
digits = args .digits
572
- if args .counter != None :
573
- seq = get_count (args .counter_path , args .counter )
572
+
573
+ # --counter and --id can be specified separately
574
+ # If omitted, --counter takes on --id
575
+ # If both are omitted, then we are not using counters in the generated names.
576
+ counter_name = args .counter
577
+ if not args .counter :
578
+ counter_name = args .id
579
+
580
+ if counter_name != None :
581
+ seq = get_count (args .counter_path , counter_name )
574
582
seq_text = str (seq )
575
583
digits = max (len (seq_text ), digits )
576
584
pad_text = "0" * (digits - len (seq_text ))
0 commit comments