diff --git a/cmd/copyright.go b/cmd/copyright.go new file mode 100644 index 0000000..ce013b4 --- /dev/null +++ b/cmd/copyright.go @@ -0,0 +1,34 @@ +// Linsk - A utility to access Linux-native file systems on non-Linux operating systems. +// Copyright (c) 2023 The Linsk Authors. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +package cmd + +import ( + "fmt" + + "github.com/spf13/cobra" +) + +var copyrightCmd = &cobra.Command{ + Use: "copyright", + Short: "Show copyright and licensing information.", + Run: func(cmd *cobra.Command, args []string) { + fmt.Print(`Copyright (c) 2023 The Linsk Authors +This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under the conditions set by the GNU General Public License v3. +You can view the full license in the LICENSE file supplied with the source code of this program. +`) + }, +} diff --git a/cmd/root.go b/cmd/root.go index df4c0e0..8d172b4 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -66,6 +66,7 @@ func init() { rootCmd.AddCommand(cleanCmd) rootCmd.AddCommand(buildCmd) rootCmd.AddCommand(versionCmd) + rootCmd.AddCommand(copyrightCmd) rootCmd.PersistentFlags().BoolVar(&vmDebugFlag, "vm-debug", false, "Enables the VM debug mode. This will open an accessible VM monitor. You can log in with root user and no password.") rootCmd.PersistentFlags().BoolVar(&unrestrictedNetworkingFlag, "vm-unrestricted-networking", false, "Enables unrestricted networking. This will allow the VM to connect to the internet.") diff --git a/main.go b/main.go index 6f113e5..1309fd5 100644 --- a/main.go +++ b/main.go @@ -1,3 +1,19 @@ +// Linsk - A utility to access Linux-native file systems on non-Linux operating systems. +// Copyright (c) 2023 The Linsk Authors. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + package main import (