karan / joe

:running: A .gitignore magician in your command line

Home Page:http://karan.github.io/joe/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add args for output instead of bash redirection

dabockster opened this issue · comments

The current method of outputting the data into an actual .gitignore file requires a redirect to be manually specified in bash. As in, the current method is directly coupled to the bash prompt.

joe java > .gitignore

How about adding in a parameter using an internal dictionary (the data type) containing all the available options and another parameter to specify the filename (since I saw that you're supporting other versions of .gitignore)?

Here's what I'm thinking:

joe java .gitignore

or

joe java

In both cases, it would increase code portability and allow potential scripting based on joe (eg adding it into a build script by calling the necessary .gitignore generator in joe automatically). All of this should still allow easy execution on the command line as-is.

In other words, can the actual output be made a part of the script instead of being dependent on a bash redirect?

I was initially thinking of going with joe java but then I realized that this isn't very extendable - if you want to build, say, a web app using joe, you'll have to modify the internal code or use private methods - neither of them is desirable.

With the bash >, it gives the user more flexibility on how to joe, and allows developers to extend it (say as an API). Here's a good example of that: http://runnable.com/VLsp2_dWQZAKoOvF/joe_from_flask-for-python