-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b39ae75
Showing
9 changed files
with
555 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
env: | ||
es6: true | ||
node: true | ||
extends: 'eslint:recommended' | ||
parserOptions: | ||
ecmaVersion: 2018 | ||
sourceType: module | ||
rules: | ||
indent: | ||
- error | ||
- 2 | ||
linebreak-style: | ||
- error | ||
- windows | ||
quotes: | ||
- error | ||
- single | ||
semi: | ||
- error | ||
- always | ||
no-console: off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
## Aplicación de comandos | ||
|
||
Recuerden instalar los paquetes de node | ||
|
||
``` | ||
npm install | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
const argv = require('./config/yargs').argv; | ||
const porHacer = require('./por-hacer/por-hacer'); | ||
const colors = require('colors'); // eslint-disable-line | ||
|
||
console.log(); | ||
|
||
let comando = argv._[0]; | ||
switch (comando) { | ||
case 'crear': | ||
{ | ||
let tarea = porHacer.crear(argv.descripcion); | ||
console.log(tarea); | ||
} | ||
break; | ||
case 'listar': | ||
{ | ||
let listado = porHacer.getListado(); | ||
for (const tarea of listado) { | ||
console.log('=======Por hacer======'.green); | ||
console.log('Descripción: ', tarea.descripcion); | ||
console.log('Estado: ', tarea.completado); | ||
console.log('======================'.green); | ||
} | ||
} | ||
break; | ||
case 'actualizar': | ||
{ | ||
let actualizado = porHacer.actualizar(argv.descripcion, argv.completado); | ||
console.log(actualizado); | ||
} | ||
break; | ||
case 'borrar': | ||
{ | ||
let borrado = porHacer.borrar(argv.descripcion); | ||
console.log(borrado); | ||
} | ||
break; | ||
|
||
default: | ||
console.log('El comando no es reconocido'); | ||
break; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
const descripcion = { | ||
alias: 'd', | ||
demand: true, | ||
desc: 'Descripción de la tarea por hacer' | ||
}; | ||
const completado = { | ||
alias: 'c', | ||
default: true, | ||
desc: 'Marca como completado o pendiente la tarea' | ||
}; | ||
const argv = require('yargs') | ||
.command('crear', 'Crear un elemento por hacer-', { descripcion }) | ||
.command('actualizar', 'Actualiza el estado completado de una tarea', { | ||
descripcion, | ||
completado | ||
}) | ||
.command('borrar', 'Borra una tarea', { descripcion }) | ||
.help().argv; | ||
|
||
module.exports = { | ||
argv | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[] |
Oops, something went wrong.