0

I am thinking of writing a java application to wrap CVS and some of our other custom build/deploy scripts. This way it will be easy to view status, do a build, publish and deploy without having to type in the commands. What is the easiest way to do this?

Offhand I'd guess I have to redirect the output from the command to a String and parse it for the information I want.

Any other techniques/suggestions?

2 Answers 2

2

For parsing command-line arguments, I recommend args4j.

UPDATE: Based on your problem description, it sounds like any or all of the following would be better options than rolling your own: Hudson, Capistrano, Fabric, or just plain-old shell scripting.

UPDATE 2: Based on the downvote and comment, you seem to be interested in interacting with the command line from the other side, i.e., driving the command line, not being driven by the command line. In that case, bitter experience suggests that Java is emphatically not the best choice. Almost any "scripting" language is a better fit. If you still want to do it, there's always ProcessBuilder and friends.

Sign up to request clarification or add additional context in comments.

2 Comments

What does this have to do with my question. I am asking about interacting with a command line, not command line arguements.
Sorry; misinterpreted your question. In my defense, reading input from the command-line very much counts as "interacting with the command-line".
1

I answered a similar question some days ago:

Implementing the "system" command in Java

Wrapping a command-line call is a bit tricky.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.