command line args

This commit is contained in:
Chapuis Bertil
2015-09-07 15:29:24 +02:00
parent 436de7f687
commit 738e78c439
6 changed files with 110 additions and 74 deletions

View File

@@ -20,7 +20,16 @@ func NewContext(path string) Context {
return Context{path}
}
func (c *Context) Repository(name string) (Repository, error) {
func (c *Context) Repository(name string) (*Repository, error) {
name, err := ParseRepositoryName(name)
return Repository{filepath.Join(c.path, name)}, err
if err != nil {
return nil, err
}
repo, err := NewRepository(filepath.Join(c.path, name))
if err != nil {
return nil, err
}
return repo, nil
}