Config command created - config show started

This commit is contained in:
Simon Aquino
2014-08-04 00:12:09 +00:00
parent 972e8c1373
commit 192152b215
3 changed files with 50 additions and 2 deletions

View File

@@ -3,12 +3,13 @@ package cmd
import (
"fmt"
"os"
"time"
"github.com/smira/aptly/aptly"
"github.com/smira/aptly/deb"
"github.com/smira/commander"
"github.com/smira/flag"
"os"
"time"
)
// ListPackagesRefList shows list of packages in PackageRefList
@@ -65,6 +66,7 @@ fine-grained changes in repository contents to transition your
package environment to new version.`,
Flag: *flag.NewFlagSet("aptly", flag.ExitOnError),
Subcommands: []*commander.Command{
makeCmdConfig(),
makeCmdDb(),
makeCmdGraph(),
makeCmdMirror(),

15
cmd/config.go Normal file
View File

@@ -0,0 +1,15 @@
package cmd
import (
"github.com/smira/commander"
)
func makeCmdConfig() *commander.Command {
return &commander.Command{
UsageLine: "config",
Short: "manage aptly configuration",
Subcommands: []*commander.Command{
makeCmdConfigShow(),
},
}
}

31
cmd/config_show.go Normal file
View File

@@ -0,0 +1,31 @@
package cmd
import "fmt"
import "github.com/smira/commander"
func aptlyConfigShow(cmd *commander.Command, args []string) error {
config := context.Config()
fmt.Printf("RootDir: %s")
return nil
}
func makeCmdConfigShow() *commander.Command {
cmd := &commander.Command{
Run: aptlyConfigShow,
UsageLine: "show",
Short: "show current aptly's config",
Long: `
Command show displays the current aptly configuration.
Example:
$ aptly config show
`,
}
return cmd
}