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

choose template straight from cli #22

Merged
merged 9 commits into from
Jun 4, 2013
Merged

choose template straight from cli #22

merged 9 commits into from
Jun 4, 2013

Conversation

krak3n
Copy link
Owner

@krak3n krak3n commented Jun 4, 2013

Hi, again.

I do not really like how -c option behaves, right now it only allows to interactively choose template, but what would be more useful, as I think, is to allow to set desired template straight from cli, for instance:

facio -n test -c mycooltemplate

facio.cfg:

[template]
mycooltemplate=/path/to/my/really/cool/template

I'd written some code about 2 months ago just for myself, but after merging with your master branch my changes are not working due to massive code base change.
So I thought this time I should file an issue.

What I think is the best way in this situation is to check if -c argument is in defined template otherwise force user to choose from interactive prompt.

Tell me what do you think?

@krak3n
Copy link
Owner

krak3n commented May 18, 2013

Sorry the Docs are not very clear on this.

-c Is to prompt for you to choose a template from the facio.cfg in the [template] section.

You can just pass a path to the template directly using -t or --template.

Take a look at the docs here: https://facio.readthedocs.org/en/latest/usage.html#template-options

Does this answer your question? :)

If you think this could work better or be more clear let me know.

@a-sk
Copy link
Contributor Author

a-sk commented May 18, 2013

Yeah, I found this in docs, but I think we could improve this behavior. Maybe we can define base template path (it even could be an array, like $PATH) in config, and then we will be able to provide just a template name to -t option, not full path. I think it can be really convenient.

@krak3n
Copy link
Owner

krak3n commented May 19, 2013

Ahh I understand what you mean, yeah I am looking and changing the config to a YAML based config in #18. This would allow multiple templates to be defined something like this:

facio:
  - templates:
    - my_template: /path/to/template
    - another: [email protected]:/path/to/repo.git

I think this looks neater and is clearer and hopefully will make it easier to implement what you're after. :)

krak3n added a commit that referenced this pull request Jun 4, 2013
choose template straight from cli
@krak3n krak3n merged commit 2a4aeb5 into develop Jun 4, 2013
@krak3n krak3n deleted the feature/issue#22 branch June 4, 2013 17:14
@krak3n
Copy link
Owner

krak3n commented Jun 4, 2013

So you can now do:

facio -n foo -t bar

bar being defined in ~/.facio.cfg

@a-sk
Copy link
Contributor Author

a-sk commented Jun 4, 2013

Very nice, thanks a lot.

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

Successfully merging this pull request may close these issues.

2 participants