Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inspiration for improvement #1

Open
serapath opened this issue Mar 13, 2016 · 2 comments
Open

Inspiration for improvement #1

serapath opened this issue Mar 13, 2016 · 2 comments

Comments

@serapath
Copy link
Owner

@serapath
Copy link
Owner Author

serapath commented Jun 8, 2017

// .dcrc (dom console rc file)
// var global = { __proto__: window }
// Object.defineProperty(global, 'ls', {
Object.defineProperty(window, 'ls', {
  // configurable: true,
  // ...
  get: function () {
    var cmd = function (a,b,c) { console.log('execute command `ls`', 'params are `a`, `b`, `c`') }
    cmd.valueOf = function () {
      setTimeout(function () { console.log('HELP for command `ls`', '...') }, 0)
      return 'ls'
    }
    return cmd
  }
})

use

// devtools console
ls
// function ls
// => HELP for command `ls`
// ...
ls(1,2,3,4)
// execute command `ls` params are `a`, `b`, `c`
ls`foo bar`
// execute command `ls` params are `a`, `b`, `c`

maybe the above needs some more thoughts about:

  • how to store references to "processes" (think: ps)
  • how to make more "cli commands" and have an overview over all of them?
  • ... more? ... what about "piping"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant