Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

Command line options for "cruise add" #63

Open
orenbenkiki opened this issue Aug 2, 2011 · 2 comments
Open

Command line options for "cruise add" #63

orenbenkiki opened this issue Aug 2, 2011 · 2 comments
Labels
Milestone

Comments

@orenbenkiki
Copy link

  1. There is no way to turn off the "interactive" option from the command line.
  2. There is no way to pass additional options to the source control objects.
@hammerdr
Copy link
Contributor

I've been looking at how this might be implemented and wanted to share the different approaches.

The first approach is to just tack these options on to the current add_project script. This is the simplest solution to implement but introduces additional complexity to the add_project script that will only be related to SCM. For example, if we wanted to do some simple argument checking to inform a user that the :watch_for_changes_in switch won't work for them in SVN, we'd need to do a big if statement that branched on the SCM choice in add_project.

To dry that up, I tried dropping in Trollop instead of optsparse because it allows for git-style subcommands. The first issue with this is that the interface would need to change. Instead of cruise add [project_name] -r [repo] -s [scm] it would be cruise add [project_name] [scm] [scm_options] or cruise add [scm] [project_name] [scm_options]. This does not seem incredibly bad to me but it would change how we do some things.

Finally, the other option I was thinking about was to not touch the add_project command and to create an configure_project command that would allow the user to modify a project from the command line. I'm not sure what all of the implications of this are, especially after a project has been created and run a few times.

@bguthrie You got some guidance for this?

Code for the trollop method: #74

@bguthrie
Copy link
Contributor

I like the idea of switching to Trollop rather than extending the existing mess. I'm a little leery about going the subcommand route--are the different options really THAT different? If they are, then this seems like a reasonable way to do it, and a reasonable way to extend the cruise command to boot.

Obviously I can't merge the pull request without a bit more testing but I like where you're going.

You should be able to configure as well as add from the command line, but I don't think adding that in removes the need to improve the existing add command.

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

No branches or pull requests

3 participants