diff --git a/cmd/cmd.go b/cmd/cmd.go index ad644eb7..4bec1f74 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -65,6 +65,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(), diff --git a/cmd/config.go b/cmd/config.go new file mode 100644 index 00000000..5eb27307 --- /dev/null +++ b/cmd/config.go @@ -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(), + }, + } +} diff --git a/cmd/config_show.go b/cmd/config_show.go new file mode 100644 index 00000000..04f28648 --- /dev/null +++ b/cmd/config_show.go @@ -0,0 +1,38 @@ +package cmd + +import ( + "encoding/json" + "fmt" + "github.com/smira/commander" +) + +func aptlyConfigShow(cmd *commander.Command, args []string) error { + + config := context.Config() + prettyJSON, err := json.MarshalIndent(config, "", " ") + + if err != nil { + return fmt.Errorf("unable to dump the config file: %s", err) + } + + fmt.Println(string(prettyJSON)) + + 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 +} diff --git a/cmd/task_run.go b/cmd/task_run.go index dfe4f02a..2e771761 100644 --- a/cmd/task_run.go +++ b/cmd/task_run.go @@ -133,16 +133,16 @@ func makeCmdTaskRun() *commander.Command { UsageLine: "run -filename= | , , ...", Short: "run aptly tasks", Long: ` -Command helps origanise multiple aptly commands in one single aptly task, running as single thread. +Command helps organise multiple aptly commands in one single aptly task, running as single thread. Example: - $ aptly task run - > repo create local - > repo add local pkg1 - > publish repo local - > serve - > + $ aptly task run + > repo create local + > repo add local pkg1 + > publish repo local + > serve + > `, } diff --git a/man/aptly.1 b/man/aptly.1 index f78fd8bd..15284323 100644 --- a/man/aptly.1 +++ b/man/aptly.1 @@ -1464,6 +1464,49 @@ Example: .P $ aptly graph . +.SH "SHOW CURRENT APTLY\(cqS CONFIG" +\fBaptly\fR \fBconfig\fR \fBshow\fR +. +.P +Command show displays the current aptly configuration\. +. +.P +Example: +. +.P +$ aptly config show +. +.SH "RUN APTLY TASKS" +\fBaptly\fR \fBtask\fR \fBrun\fR \-filename=\fIfilename\fR \fB|\fR \fIcommand1\fR, \fIcommand2\fR, \fB\|\.\|\.\|\.\fR +. +.P +Command helps organise multiple aptly commands in one single aptly task, running as single thread\. +. +.P +Example: +. +.IP "" 4 +. +.nf + + $ aptly task run + > repo create local + > repo add local pkg1 + > publish repo local + > serve + > +. +.fi +. +.IP "" 0 +. +.P +Options: +. +.TP +\-\fBfilename\fR= +specifies the filename that contains the commands to run +. .SH "ENVIRONMENT" If environment variable \fBHTTP_PROXY\fR is set \fBaptly\fR would use its value to proxy all HTTP requests\. . diff --git a/man/aptly.1.ronn.tmpl b/man/aptly.1.ronn.tmpl index b2674547..1c49a15b 100644 --- a/man/aptly.1.ronn.tmpl +++ b/man/aptly.1.ronn.tmpl @@ -245,6 +245,10 @@ When specified on command line, query may have to be quoted according to shell r {{template "command" findCommand . "graph"}} +{{template "command" findCommand . "config"}} + +{{template "command" findCommand . "task"}} + ## ENVIRONMENT If environment variable `HTTP_PROXY` is set `aptly` would use its value diff --git a/system/t03_help/MainTest_gold b/system/t03_help/MainTest_gold index 9c70828b..3339c975 100644 --- a/system/t03_help/MainTest_gold +++ b/system/t03_help/MainTest_gold @@ -3,6 +3,7 @@ aptly - Debian repository management tool Commands: api start API server/issue requests + config manage aptly configuration db manage aptly's internal database and package pool graph render graph of relationships mirror manage mirrors of remote repositories