pijul 0.7.2

A patch-based distributed version control system, easy to use and fast. Command-line interface.
#![recursion_limit="128"]
#[macro_use]
extern crate clap;
#[macro_use]
extern crate log;
extern crate env_logger;
extern crate libpijul;
extern crate getch;
extern crate toml;
extern crate regex;
extern crate hyper;
extern crate hyper_rustls;
extern crate chrono;
extern crate thrussh;
extern crate thrussh_keys;
extern crate term;
extern crate rand;
extern crate tokio_core;
extern crate futures;
extern crate user;
extern crate shell_escape;
extern crate rustyline;
extern crate tar;
extern crate flate2;
extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate base64;
extern crate hex;
extern crate ring;
extern crate ignore;
#[macro_use]
extern crate error_chain;
extern crate bincode;

mod error;
mod commands;
mod meta;

macro_rules! pijul_subcommand_dispatch {
    ($default:expr, $p:expr => $($subcommand_name:expr => $subcommand:ident),*) => {{
        match $p {
            $(($subcommand_name, Some(args)) =>
             {
                 let res = commands::$subcommand::run(&args);
                 commands::$subcommand::explain(res)
             }
              ),*
                ("", None) => { $default; println!(""); },
            _ => panic!("Incorrect subcommand name")
        }
    }}
}

fn main() {
    env_logger::init().unwrap();
    let time0 = chrono::Local::now();
    let version = crate_version!();
    let app = clap::App::new("pijul")
        .version(&version[..])
        .author("Pierre-Étienne Meunier and Florent Becker")
        .about("Version Control: fast, distributed, easy to use; pick any three");
    let app = app.subcommands(commands::all_command_invocations());
    let mut app_help = app.clone();

    let args = app.get_matches();
    pijul_subcommand_dispatch!(app_help.print_help().unwrap(), args.subcommand() =>
                               "info" => info,
                               "changes" => changes,
                               "patch" => patch,
                               "init" => init,
                               "add" => add,
                               "record" => record,
                               "pull" => pull,
                               "push" => push,
                               "apply" => apply,
                               "clone" => clone,
                               "remove" => remove,
                               "mv" => mv,
                               "ls" => ls,
                               "revert" => revert,
                               "unrecord" => unrecord,
                               "fork" => fork,
                               "branches" => branches,
                               "delete-branch" => delete_branch,
                               "checkout" => checkout,
                               "diff" => diff,
                               "blame" => blame,
                               "dist" => dist,
                               "keys" => keys,
                               "status" => status,
                               "show-dependencies" => show_dependencies
                               );
    let time1 = chrono::Local::now();
    info!("The command took: {:?}", time1.signed_duration_since(time0));
}