mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-15 07:18:04 +00:00
i used this script, a little clunky but it got the job done
```bash
for file in `find . -type f -print | grep '\.go'`; do
sed '1,/^\/\/ limitations under the License.$/d' $file > $file.tmp;
result=`cat $file.tmp`
if [[ result != "" ]]; then
gofmt $file.tmp &> /dev/null;
if [[ $? == 0 ]]; then
mv $file.tmp $file && gofmt -w $file;
else
rm $file.tmp;
fi
else
rm $file.tmp;
fi
done
```
33 lines
755 B
Go
33 lines
755 B
Go
package cmd
|
|
|
|
import (
|
|
"context"
|
|
"io"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/molecula/featurebase/v2/ctl"
|
|
"github.com/molecula/featurebase/v2/server"
|
|
)
|
|
|
|
var conf *ctl.ConfigCommand
|
|
|
|
func newConfigCommand(stdin io.Reader, stdout, stderr io.Writer) *cobra.Command {
|
|
conf = ctl.NewConfigCommand(stdin, stdout, stderr)
|
|
Server := server.NewCommand(stdin, stdout, stderr)
|
|
confCmd := &cobra.Command{
|
|
Use: "config",
|
|
Short: "Print the current configuration.",
|
|
Long: `config prints the current configuration to stdout`,
|
|
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
conf.Config = Server.Config
|
|
return conf.Run(context.Background())
|
|
},
|
|
}
|
|
|
|
// Attach flags to the command.
|
|
ctl.BuildServerFlags(confCmd, Server)
|
|
|
|
return confCmd
|
|
}
|