vadimdemedes / ronin

Toolkit for killer CLI applications
http://vdemedes.github.io/ronin
MIT License
299 stars 15 forks source link

Pass options as object #11

Closed igord closed 9 years ago

igord commented 9 years ago

Currently, options are passed to run method as parameters. That's good when you have just a couple of options, but when there are many options it gets ugly:

  run: function (host, port, context, username, password, portal, target, targetArg, method, file, rights, tag, query, verbose, json, save) {
        // create object because you need to have options in a module context
        cfg = {
            host: host,
            port: port,
            context: context,
            username: username,
            password: password,
            portal: portal,
            target: target,
            targetArg: targetArg,
            method: method,
            file: file,
            rights: rights,
            tag: tag,
            query: query,
            verbose: verbose,
            json: json,
            save: save
        }

It would be nice to have an setting to pass options as object.

vadimdemedes commented 9 years ago

Thank you, good point, will be fixed.