#!/usr/bin/env node

//const lo = require('./logic');
//console.log(lo.toLower("Supharoek Sudadet"));

const program = require('commander');

const { addContract, getContract } = require('./logic');

program
  .version('0.0.1')
  .description('Contact management system');

program
  .command('addContact <firstname> <lastname> <phone> <email>')
  .alias('a')
  .description('เพิ่มข้อมูล')
  .action((firstname, lastname, phone, email) => {
    addContact({firstname, lastname, phone, email});
    //console.log(`User: ${firstname} ${lastname} ${phone} ${email}`);
  });

program
  .command('getContact <name>')
  .alias('r')
  .description('Get contact')
  .action(name => getContact(name));

  /*program
  .command('programmer')
  .alias('p')
  .description('ดูข้อมูลโปรแกรมเมอร์')
  .action(() => {
  console.log(`programmer คือ ยิว`);
  });
  */
program.parse(process.argv);

