Update code for usage message

This commit is contained in:
August-Brandt
2024-07-27 11:43:59 +02:00
parent 7bc6763903
commit edc34e8df4
+14 -3
View File
@@ -50,7 +50,6 @@ func main() {
authors = envVar authors = envVar
} }
file, err := os.Open(authors) file, err := os.Open(authors)
if err != nil { if err != nil {
authors, _ = os.UserConfigDir() authors, _ = os.UserConfigDir()
@@ -237,13 +236,25 @@ func NoInput(args []string, users map[string]user) {
create_author_file() create_author_file()
} }
// if calling binary with nothing or only string // if calling binary with nothing or only string
print("Usage: cocommit <commit message> <co-author1> [co-author2] [co-author3] || \ncocommit <commit message> <co-author1:email> [co-author2:email] [co-author3:email] || \ncocommit <commit message> all || \ncocommit <commit message> ^<co-author1> ^[co-author2] || \ncocommit <commit message> <group> || \ncocommit users || \nMixes of both") command_options := []string{
"cocommit <commit message> <co-author1> [co-author2] [co-author3]",
"cocommit <commit message> <co-author1:email> [co-author2:email] [co-author3:email]",
"cocommit <commit message> all",
"cocommit <commit message> ^<co-author1> ^[co-author2]",
"cocommit <commit message> <group>",
"cocommit users",
}
println("Usage:")
for _, v := range command_options {
print(v)
println(" ||")
}
println("Mixes of both")
os.Exit(1) os.Exit(1)
} }
} }
func create_author_file(param ...string) { func create_author_file(param ...string) {
var input string var input string
authors, err := os.UserConfigDir() authors, err := os.UserConfigDir()