#!/usr/local/bin/perl -w
$debug = 1;
use lib "/home/jroth/build/flow/Audio-Multitrack/lib";;
use Audio::Multitrack::Assign qw(:all);
$in = qx(cat ./commands.yml);
my $ref = yaml_in( $in); 
#print yaml_out $ref;
#exit;
map { my $func = $_; 
	my @parts = ($func, split " ", $ref->{$func}->{short});
	my @all_parts = @parts;
	my $full = shift @parts;
	my @short = @parts;
	my $end_anchor = "end";
	push @abbrevs,	"_$full: '" . join ("' | '" , @all_parts). "'";
	push @stubs,   	"$full: _$full $end_anchor { 1 }";
	push @commands,	"command: $full";
} sort keys %{ $ref };
print join "\n", @commands, @abbrevs, @stubs ;
