I would like to have a composable cli tool with subcommands for management of the Flux Feed application. This PR restructures the cmd package according to conventions outlined in the Cobra user guide https://github.com/spf13/cobra/blob/main/site/content/user_guide.md At present only the database migrate command is implemented, and with minimal functionality. Future work will have to add additional flags and information on how to declare the location of the database to be migrated. Reviewed-on: #2main
parent
c3f271bcfd
commit
840b84b120
@ -1,5 +1,25 @@
|
||||
# Flux Feed
|
||||
|
||||
![build-status](https://drone.runcible.io/api/badges/androiddrew/flux-feed/status.svg)
|
||||
[![](https://img.shields.io/badge/License-AGPL-blue.svg)](https://opensource.org/licenses/AGPL "License: AGPL")
|
||||
|
||||
An Indie Reader for the modern day.
|
||||
An Indie Reader for the modern day.
|
||||
|
||||
|
||||
## Building
|
||||
|
||||
From the root of the source tree run:
|
||||
|
||||
```shell
|
||||
make build
|
||||
```
|
||||
|
||||
## Using
|
||||
|
||||
```shell
|
||||
./fluxctl --help
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
is project is licensed under the MIT License. See the [LICENSE file](https://git.runcible.io/androiddrew/flux-feed/src/branch/main/LICENSE) for the full license text.
|
@ -0,0 +1,26 @@
|
||||
// Package cmd provides cli commands
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var rootCmd = &cobra.Command{
|
||||
Use: "fluxctl",
|
||||
Short: "A flexible indie reader for the modern day",
|
||||
}
|
||||
|
||||
// Execute executes the root command.
|
||||
func Execute() {
|
||||
if err := rootCmd.Execute(); err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(MigrateCmd)
|
||||
}
|
Loading…
Reference in New Issue