GoToSocial/cmd/gotosocial/main.go

57 lines
1.3 KiB
Go
Raw Normal View History

2021-02-28 15:17:18 +01:00
/*
2021-03-01 15:41:43 +01:00
GoToSocial
Copyright (C) 2021 GoToSocial Authors admin@gotosocial.org
2021-02-28 15:17:18 +01:00
2021-03-01 15:41:43 +01:00
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
2021-02-28 15:17:18 +01:00
2021-03-01 15:41:43 +01:00
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
2021-02-28 15:17:18 +01:00
2021-03-01 15:41:43 +01:00
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
2021-02-28 15:17:18 +01:00
*/
2021-02-27 22:57:50 +01:00
package main
import (
2021-03-02 22:52:31 +01:00
"os"
"github.com/sirupsen/logrus"
2021-03-03 11:28:28 +01:00
_ "github.com/superseriousbusiness/gotosocial/docs"
2021-03-03 11:28:28 +01:00
"github.com/urfave/cli/v2"
2021-02-27 22:57:50 +01:00
)
// Version is the software version of GtS being used
var Version string
// Commit is the git commit of GtS being used
var Commit string
//go:generate swagger generate spec
2021-02-27 22:57:50 +01:00
func main() {
var v string
if Commit == "" {
v = Version
} else {
v = Version + " " + Commit[:7]
}
2021-05-09 11:25:13 +02:00
app := &cli.App{
Version: v,
Usage: "a fediverse social media server",
Flags: getFlags(),
Commands: getCommands(),
2021-03-02 22:52:31 +01:00
}
2021-03-03 11:28:28 +01:00
err := app.Run(os.Args)
if err != nil {
logrus.Fatal(err)
2021-03-02 22:52:31 +01:00
}
2021-02-27 22:57:50 +01:00
}