vicoapp / vico

Mac Programmers Text Editor
http://www.vicoapp.com/
657 stars 89 forks source link

Add option to vicotool to create a new document with text from stdin #32

Closed stefan991 closed 11 years ago

stefan991 commented 12 years ago

Other Editors can create new documents from text that is piped into their commandline tools. I implemented that future the way (Mac)Vim has implemented it: when the first filename is "-" than it reads the text from stdin.

Example: the following command opens a new document in the current window with the output of ls in it.

 $ ls -l | vicotool -

Updated usage text:

syntax: vicotool [options] [file ...]    edit specified file(s)
    or: vicotool [options] -             read text from stdin
options:
    -h            show this help
    -e string     evaluate the string as a Nu script
    -f file       read file and evaluate as a Nu script
    -n            open files in a new window
    -p params     read script parameters as a JSON string
    -p -          read script parameters as JSON from standard input
    -r            enter runloop (don't exit script immediately)
    -w            wait for document to close

This is my first Pull Request ever, so I hope i have done everything correct :)

Shadowfiend commented 11 years ago

I'm going to try and give this fellow a test drive sometime this week and merge it in if everything goes well.

Shadowfiend commented 11 years ago

Works as advertised, let's do it!