<commit_before>#!/bin/bash

##########################################################################
# Copyright (c) 2009, 2011, ETH Zurich.
# All rights reserved.
#
# This file is distributed under the terms in the attached LICENSE file.
# If you do not find this file, copies can be found by writing to:
# ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
##########################################################################

DFLTARCHS="\"x86_64\""
RUN_HAKE="Yes"

usage() { 
    echo "Usage: $0 <options>"
    echo "   -s|--source-dir: path to source tree (required)"
    echo "   -i|--install-dir: path to install directory (defaults to \`pwd\`)"
    echo "   -a|--architecture: specify archtitecture to build for (can be"
    echo "       given multiple times, default architectures are"
    echo "       $DFLTARCHS"
    echo "   -n|--no-hake: just rebuild hake itself, don't run it (only useful"
    echo "       for debugging hake)"
    echo ""
    echo "  The way you use this script is to create a new directory for your"
    echo "  build tree, cd into it, and run this script with the --source-dir"
    echo "  argument specifying the top of the source tree."
    exit 1;
}

#
# Legacy compatibility to avoid breaking the harness...
#
if [ $# -eq 1 ]; then
    echo "WARNING: old usage of hake.sh (sole argument gives the source directory) is"
    echo "deprecated: please use --source-dir instead."
    SRCDIR="$1"
    shift
fi

#
# Parse args
#
while [ $# -ne 0 ]; do
    case $1 in
	"-a"|"--architecture") 
	    if [ -z "$NEWARCHS" ] ; then
		NEWARCHS="\"$2\""
	    else
		NEWARCHS="$NEWARCHS, \"$2\""
	    fi
	    ;;
	"-i"|"--install-dir")
	    INSTALLDIR="$2"
	    ;;
	"-s"|"--source-dir")
	    SRCDIR="$2"
	    ;;
	"-n"|"--no-hake")
	    RUN_HAKE="No"
	    ;;
	*) 
	    usage
	    ;;
    esac
    shift 
    shift
done

if [ -z "$INSTALLDIR"] ; then
    echo "Install directory defaulting to '.'"
    INSTALLDIR="."
else
    echo "Install directory is $INSTALLDIR"
fi
cd $INSTALLDIR<commit_msg>hake.sh: add missing space in bash test<commit_after>#!/bin/bash

##########################################################################
# Copyright (c) 2009, 2011, ETH Zurich.
# All rights reserved.
#
# This file is distributed under the terms in the attached LICENSE file.
# If you do not find this file, copies can be found by writing to:
# ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
##########################################################################

DFLTARCHS="\"x86_64\""
RUN_HAKE="Yes"

usage() { 
    echo "Usage: $0 <options>"
    echo "   -s|--source-dir: path to source tree (required)"
    echo "   -i|--install-dir: path to install directory (defaults to \`pwd\`)"
    echo "   -a|--architecture: specify archtitecture to build for (can be"
    echo "       given multiple times, default architectures are"
    echo "       $DFLTARCHS"
    echo "   -n|--no-hake: just rebuild hake itself, don't run it (only useful"
    echo "       for debugging hake)"
    echo ""
    echo "  The way you use this script is to create a new directory for your"
    echo "  build tree, cd into it, and run this script with the --source-dir"
    echo "  argument specifying the top of the source tree."
    exit 1;
}

#
# Legacy compatibility to avoid breaking the harness...
#
if [ $# -eq 1 ]; then
    echo "WARNING: old usage of hake.sh (sole argument gives the source directory) is"
    echo "deprecated: please use --source-dir instead."
    SRCDIR="$1"
    shift
fi

#
# Parse args
#
while [ $# -ne 0 ]; do
    case $1 in
	"-a"|"--architecture") 
	    if [ -z "$NEWARCHS" ] ; then
		NEWARCHS="\"$2\""
	    else
		NEWARCHS="$NEWARCHS, \"$2\""
	    fi
	    ;;
	"-i"|"--install-dir")
	    INSTALLDIR="$2"
	    ;;
	"-s"|"--source-dir")
	    SRCDIR="$2"
	    ;;
	"-n"|"--no-hake")
	    RUN_HAKE="No"
	    ;;
	*) 
	    usage
	    ;;
    esac
    shift 
    shift
done

if [ -z "$INSTALLDIR" ] ; then
    echo "Install directory defaulting to '.'"
    INSTALLDIR="."
else
    echo "Install directory is $INSTALLDIR"
fi
cd $INSTALLDIR
{'fraction_non_alphanumeric': 0.199854121079504, 'fraction_numerical': 0.01312910284463895, 'mean_word_length': 2.79870729455217, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6088681', 'n_tokens_mistral': 1461, 'n_tokens_neox': 1295, 'n_words': 453}