<commit_before>our sub USAGE ($sub=&MAIN) {
    my @subs = $sub ~~ Multi  ?? $sub.candidates !! ($sub);
    my @help-msgs = @subs.map( { USAGE-one-sub ($_) } ) ;
    return  "Usage\n" ~ @help-msgs.join("\nor\n");
}

our sub USAGE-one-sub ($sub=&MAIN) {
    my $sig = $sub.signature;
    my @arguments;
    for $sig.params -> $param {
        my $argument;
        if ($param.named) {
            $argument = "--"
                    ~ $param.name.substr(1)
                    ~ ($param.type ~~ Bool ?? '' !! "=value-of-{$param.name.substr(1)}")
                    ;
        } else {
            $argument = $param.name.substr(1);
            if ($param.slurpy) {
                $argument ~= " [more [...]]";
            }
        }
        $argument = "[$argument]" if $param.optional;
        @arguments.push($argument);
    }

    return  $*PROGRAM_NAME ~ ' '  ~ @arguments.join(' ');

}

our sub process-cmd-args(@args is copy, %named) {
    my (@positional-arguments, %named-arguments , $negate);
    while ( @args )  {
        my $passed_value = @args.shift;
        if substr($passed_value,0,2) eq '--' {
            my $arg = $passed_value.substr(2);
            if $arg.match(/^\//) {
                $arg .= substr(1) ;
                $negate = $arg;
            }

            if $arg eq '' {
                @positional-arguments.push: @args;<commit_msg>Better usage message when using -e<commit_after>our sub USAGE ($sub=&MAIN) {
    my @subs = $sub ~~ Multi  ?? $sub.candidates !! ($sub);
    my @help-msgs = @subs.map( { USAGE-one-sub ($_) } ) ;
    return  "Usage\n" ~ @help-msgs.join("\nor\n");
}

our sub USAGE-one-sub ($sub=&MAIN) {
    my $sig = $sub.signature;
    my @arguments;
    for $sig.params -> $param {
        my $argument;
        if ($param.named) {
            $argument = "--"
                    ~ $param.name.substr(1)
                    ~ ($param.type ~~ Bool ?? '' !! "=value-of-{$param.name.substr(1)}")
                    ;
        } else {
            $argument = $param.name.substr(1);
            if ($param.slurpy) {
                $argument ~= " [more [...]]";
            }
        }
        $argument = "[$argument]" if $param.optional;
        @arguments.push($argument);
    }

    return  ($*PROGRAM_NAME eq '-e' ?? "-e '...'" !! $*PROGRAM_NAME )~ ' '  ~ @arguments.join(' ');

}

our sub process-cmd-args(@args is copy, %named) {
    my (@positional-arguments, %named-arguments , $negate);
    while ( @args )  {
        my $passed_value = @args.shift;
        if substr($passed_value,0,2) eq '--' {
            my $arg = $passed_value.substr(2);
            if $arg.match(/^\//) {
                $arg .= substr(1) ;
                $negate = $arg;
            }

            if $arg eq '' {
                @positional-arguments.push: @args;
{'fraction_non_alphanumeric': 0.18993216708318458, 'fraction_numerical': 0.004998214923241699, 'mean_word_length': 1.6065116279069767, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5853745', 'n_tokens_mistral': 953, 'n_tokens_neox': 921, 'n_words': 178}