<commit_before>extern crate getopts;
extern crate time;

use std::collections::LinkedList;
use std::str::Split;

mod args;

fn main() {
    let args: std::env::Args = std::env::args();
    let opts = args::parse_args(args);
    let dow = ["Duinday", "Sitaday", "Wikiday", "Tuxday", "Gnuday", "Commonday"];
    let moy = ["Jabim", "Zodrak", "Trogool", "Yanar", "Shkumbe", "Habniah", "Skarl", "Mikon", "Pertunda", "Kib", "Broket"];
    let dpm = 33;
    let dpw = dow.len();
    let mpy = moy.len();
    let (year, month, day, yoff) = current_day(time::now());
    let wd = (yoff + month * 3 + day - 1) % dpw;
    let mut moff = yoff;
    let mut months_across = LinkedList::<String>::new();

    if opts.exit {
        return;
    }

    if !opts.date_only {
		for mm in 0..mpy {
		    let spaces = (17 - moy[mm].len()) / 2;
		    let mut month_text = format!("");
		    for _ in 0..spaces {
		        month_text = format!("{} ", month_text);
		    }

		    month_text = format!("{}{}", month_text, moy[mm]);
		    for _ in 0..(18 - spaces - moy[mm].len()) {
		        month_text = format!("{} ", month_text);
		    }

		    month_text = format!("{}\n", month_text);
		    for dd in 0..dpw {
		        let mut abbrd = String::from(dow[dd]);
		        abbrd.truncate(2);
		        month_text = format!("{}{} ", month_text, abbrd);
		    }

		    let dd = if mm == month { day } else { 1000 };
		    let days = format_days(moff, dpm, dpw, dd);
		    month_text = format!("{}{}", month_text, days.0);
		    moff = days.1;
		    if mm == 2 {
		        month_text = format!("{}--  Peer  Day  --", month_text);
		    }
		    else if mm == 6 {
		        month_text = format!("{}--Torrent Feast--", month_text);
		    }
		    else if is_leap_year(year) && mm == 10 {
		        month_text = format!("{}--Immersion Day--", month_text);
		    }

		    month_text = format!("{}\n", month_text);
		    months_across.push_back(month_text);
		    if mm % 4 == 3 {
		        month_zipper(months_across.clone(), "   ", 1);
		        months_across.clear();
		    }
		}

		month_zipper(months_across.clone(), "   ", 11);
    }

	let mut datestr = format!("{}, {:02} of {}", dow[wd], day, moy[month]);
	let mut daystr = format!("{:02}.{:02}", month + 1, day);
	if day == 34 {
	    if month == 2 {
	        datestr = format!("Peer Day");
	        daystr = format!("P");
	    }
	    else if month == 6 {
	        datestr = format!("Torrent Feast");
	        daystr = format!("T");
	    }
	    else if month == 10 {
	        datestr = format!("Immersion Feast");
	        daystr = format!("T");
	    }
	}

    let hol = format!("{}", what_holiday(month, day));
    println!("Today is {} {}{}.  [{}.{}]", datestr, year, hol, year, daystr);
}

fn format_days(moff: usize, dpm: usize, dpw: usize, highlight: usize) -> (String, usize) {
    let mut month = format!("");

    if moff != 0 {
        month = format!("{}\n", month);
    }

    for _ in 0 .. moff {
        month = format!("{}   ", month);
    }

    for day in 1 .. dpm + 1 {
        if (day + moff) % dpw == 1 {
            month = format!("{}\n", month);
        }

        let ch = if day == highlight { ">" } else if day + 1 == highlight { "<" } else { " " };
        month = format!("{}{:2}{}", month, day, ch);
    }

    for _ in 0 .. (3 - moff) {
        month = format!("{}   ", month);
    }

    month = format!("{}\n", month);<commit_msg>Only print date when month and year aren't selected<commit_after>extern crate getopts;
extern crate time;

use std::collections::LinkedList;
use std::str::Split;

mod args;

fn main() {
    let args: std::env::Args = std::env::args();
    let opts = args::parse_args(args);
    let dow = ["Duinday", "Sitaday", "Wikiday", "Tuxday", "Gnuday", "Commonday"];
    let moy = ["Jabim", "Zodrak", "Trogool", "Yanar", "Shkumbe", "Habniah", "Skarl", "Mikon", "Pertunda", "Kib", "Broket"];
    let dpm = 33;
    let dpw = dow.len();
    let mpy = moy.len();
    let (year, month, day, yoff) = current_day(time::now());
    let wd = (yoff + month * 3 + day - 1) % dpw;
    let mut moff = yoff;
    let mut months_across = LinkedList::<String>::new();

    if opts.exit {
        return;
    }

    if !opts.date_only {
		for mm in 0..mpy {
		    let spaces = (17 - moy[mm].len()) / 2;
		    let mut month_text = format!("");
		    for _ in 0..spaces {
		        month_text = format!("{} ", month_text);
		    }

		    month_text = format!("{}{}", month_text, moy[mm]);
		    for _ in 0..(18 - spaces - moy[mm].len()) {
		        month_text = format!("{} ", month_text);
		    }

		    month_text = format!("{}\n", month_text);
		    for dd in 0..dpw {
		        let mut abbrd = String::from(dow[dd]);
		        abbrd.truncate(2);
		        month_text = format!("{}{} ", month_text, abbrd);
		    }

		    let dd = if mm == month { day } else { 1000 };
		    let days = format_days(moff, dpm, dpw, dd);
		    month_text = format!("{}{}", month_text, days.0);
		    moff = days.1;
		    if mm == 2 {
		        month_text = format!("{}--  Peer  Day  --", month_text);
		    }
		    else if mm == 6 {
		        month_text = format!("{}--Torrent Feast--", month_text);
		    }
		    else if is_leap_year(year) && mm == 10 {
		        month_text = format!("{}--Immersion Day--", month_text);
		    }

		    month_text = format!("{}\n", month_text);
		    months_across.push_back(month_text);
		    if mm % 4 == 3 {
		        month_zipper(months_across.clone(), "   ", 1);
		        months_across.clear();
		    }
		}

		month_zipper(months_across.clone(), "   ", 11);
    }

    if !opts.has_year || !opts.has_month {
		let mut datestr = format!("{}, {:02} of {}", dow[wd], day, moy[month]);
		let mut daystr = format!("{:02}.{:02}", month + 1, day);
		if day == 34 {
			if month == 2 {
			    datestr = format!("Peer Day");
			    daystr = format!("P");
			}
			else if month == 6 {
			    datestr = format!("Torrent Feast");
			    daystr = format!("T");
			}
			else if month == 10 {
			    datestr = format!("Immersion Feast");
			    daystr = format!("T");
			}
		}

		let hol = format!("{}", what_holiday(month, day));
		println!("Today is {} {}{}.  [{}.{}]", datestr, year, hol, year, daystr);
    }
}

fn format_days(moff: usize, dpm: usize, dpw: usize, highlight: usize) -> (String, usize) {
    let mut month = format!("");

    if moff != 0 {
        month = format!("{}\n", month);
    }

    for _ in 0 .. moff {
        month = format!("{}   ", month);
    }

    for day in 1 .. dpm + 1 {
        if (day + moff) % dpw == 1 {
            month = format!("{}\n", month);
        }

        let ch = if day == highlight { ">" } else if day + 1 == highlight { "<" } else { " " };
        month = format!("{}{:2}{}", month, day, ch);
    }

    for _ in 0 .. (3 - moff) {
        month = format!("{}   ", month);
    }

    month = format!("{}\n", month);
{'fraction_non_alphanumeric': 0.19853694220921728, 'fraction_numerical': 0.014923189465983906, 'mean_word_length': 2.204875761837787, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '45897', 'n_tokens_mistral': 2702, 'n_tokens_neox': 2445, 'n_words': 628}