<commit_before>#![crate_id(name="kill", vers="0.0.1", author="<NAME>")]
#![feature(macro_rules)]
#![feature(phase)]

/*
 * This file is part of the uutils coreutils package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE file
 * that was distributed with this source code.
 */


extern crate getopts;
extern crate collections;
extern crate serialize;

#[phase(syntax, link)] extern crate log;

use std::os;
use std::from_str::from_str;
use std::io::process::Process;

use getopts::{
    getopts,
    optopt,
    optflag,
    optflagopt,
    usage,
};

use signals::{
    ALL_SIGNALS,
    DEFAULT_SIGNAL,
};

mod signals;

#[path = "../common/util.rs"]
mod util;

static NAME: &'static str = "kill";
static VERSION:  &'static str = "0.0.1";

static EXIT_OK:  i32 = 0;
static EXIT_ERR: i32 = 1;



pub enum Mode {
    Kill,
    Table,
    List,
    Help,
    Version,
}


fn main() {
    let args = os::args();

    let opts = ~[
        optflag("h", "help", "display this help and exit"),
        optflag("V", "version", "output version information and exit"),
        optopt("s", "signal", "specify the <signal> to be sent", "SIGNAL"),
        optflagopt("l", "list", "list all signal names, or convert one to a name", "LIST"),
        optflag("L", "table", "list all signal names in a nice table"),
    ];

    let usage = usage("[options] <pid> [...]", opts);


    let matches = match getopts(args.tail(), opts) {
        Ok(m) => m,
        Err(e) => {
            let msg = format!("{}\n{}", e.to_err_msg(),  get_help_text(NAME, usage));
            show_error!(EXIT_ERR, "{}", msg);
            return
        },
    };


    let mode = if matches.opt_present("version") {
        Version
    } else if matches.opt_present("help") {
        Help
    } else if matches.opt_present("table") {
        Table
    } else if matches.opt_present("list") {
        List
    } else {
        Kill
    };

    match mode {
        Kill    => kill(matches.opt_str("signal").unwrap_or(~"9"), matches.free),
        Table   => table(),
        List    => list(matches.opt_str("list")),<commit_msg>pass params directly to show_error macro<commit_after>#![crate_id(name="kill", vers="0.0.1", author="<NAME>")]
#![feature(macro_rules)]
#![feature(phase)]

/*
 * This file is part of the uutils coreutils package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE file
 * that was distributed with this source code.
 */


extern crate getopts;
extern crate collections;
extern crate serialize;

#[phase(syntax, link)] extern crate log;

use std::os;
use std::from_str::from_str;
use std::io::process::Process;

use getopts::{
    getopts,
    optopt,
    optflag,
    optflagopt,
    usage,
};

use signals::{
    ALL_SIGNALS,
    DEFAULT_SIGNAL,
};

mod signals;

#[path = "../common/util.rs"]
mod util;

static NAME: &'static str = "kill";
static VERSION:  &'static str = "0.0.1";

static EXIT_OK:  i32 = 0;
static EXIT_ERR: i32 = 1;



pub enum Mode {
    Kill,
    Table,
    List,
    Help,
    Version,
}


fn main() {
    let args = os::args();

    let opts = ~[
        optflag("h", "help", "display this help and exit"),
        optflag("V", "version", "output version information and exit"),
        optopt("s", "signal", "specify the <signal> to be sent", "SIGNAL"),
        optflagopt("l", "list", "list all signal names, or convert one to a name", "LIST"),
        optflag("L", "table", "list all signal names in a nice table"),
    ];

    let usage = usage("[options] <pid> [...]", opts);


    let matches = match getopts(args.tail(), opts) {
        Ok(m) => m,
        Err(e) => {
            show_error!(EXIT_ERR, "{}\n{}", e.to_err_msg(),  get_help_text(NAME, usage));
            return
        },
    };


    let mode = if matches.opt_present("version") {
        Version
    } else if matches.opt_present("help") {
        Help
    } else if matches.opt_present("table") {
        Table
    } else if matches.opt_present("list") {
        List
    } else {
        Kill
    };

    match mode {
        Kill    => kill(matches.opt_str("signal").unwrap_or(~"9"), matches.free),
        Table   => table(),
        List    => list(matches.opt_str("list")),
{'fraction_non_alphanumeric': 0.16257883672039244, 'fraction_numerical': 0.006073347348750292, 'mean_word_length': 2.7202432667245873, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 25, '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': '5538931', 'n_tokens_mistral': 1436, 'n_tokens_neox': 1411, 'n_words': 405}