import yargs from 'yargs';

export default class Arguments {
    /* --- globals --- */

    /* --- constants --- */

    /* --- constructor --- */

    /**
     * Initializes the cli arguments
     *
     * @param  [Object] args
     */
    constructor(args={}) {
        const defaults = {
            h: {
                alias: 'help',
                description: 'Displays help message.'
            }
        };

        this.yargs = yargs;
        this.args = this.yargs
            .usage('Usage: $0')
            .help('h')
            .options(Object.assign({}, defaults, args))
            .argv;
    }

    /* --- protected --- */

    /* --- public --- */

    /**
     * Returns a single argument value
     *
     * @param  [String] key
     * @return [Mixed]
     */
    get(key) {
        return this.args[key];
    }

    /**
     * Returns all argument values
     *
     * @return [Object]
     */
    all() {
        return this.args;
    }
}

@@ -246,19 +246,22 @@
 tructor(
-arg
+option
 s=%7B%7D) %7B%0A
@@ -445,40 +445,8 @@
 args
-;%0A        this.args = this.yargs
 %0A   
@@ -550,14 +550,19 @@
 ts, 
-arg
+option
 s))
+;%0A
 %0A   
@@ -570,17 +570,77 @@
     
-    
+this.options = this.yargs.argv;%0A        this.args = this.yargs
 .argv
+._
 ;%0A  
@@ -847,19 +847,22 @@
 rn this.
-arg
+option
 s%5Bkey%5D;%0A
@@ -982,19 +982,22 @@
 rn this.
-arg
+option
 s;%0A    %7D

add cli args andmoved options to this.options