Command descriptions

This commit is contained in:
AlexSSD7 2023-08-29 10:37:52 +01:00
commit 443dbf684c
6 changed files with 20 additions and 24 deletions

View file

@ -10,11 +10,9 @@ import (
)
var rootCmd = &cobra.Command{
Use: "imgbuilder",
// TODO: Fill this
// Short: "",
// Long: ``,
Args: cobra.ExactArgs(2),
Use: "imgbuilder",
Short: "Build an Alpine Linux image for Linsk. A base Alpine VM disc image is required.",
Args: cobra.ExactArgs(2),
Run: func(cmd *cobra.Command, args []string) {
baseISOPath := filepath.Clean(args[0])
outImagePath := filepath.Clean(args[1])

View file

@ -13,10 +13,9 @@ import (
)
var lsCmd = &cobra.Command{
Use: "ls",
// TODO: Fill this
// Short: "",
Args: cobra.ExactArgs(1),
Use: "ls",
Short: "Start a VM and list all user drives within the VM. Uses lsblk command under the hood.",
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
os.Exit(runVM(args[0], func(ctx context.Context, i *vm.VM, fm *vm.FileManager) int {
lsblkOut, err := fm.Lsblk()

View file

@ -9,10 +9,12 @@ import (
)
var rootCmd = &cobra.Command{
Use: "linsk",
// TODO: Fill this
// Short: "",
// Long: ``,
Use: "linsk",
Short: "Access Linux-native file system infrastructure (including LVM and LUKS) on macOS and Linux. Powered by a lightweight Alpine Linux VM and FTP.",
Long: `Linsk is a utility that allows you to access Linux-native file system infrastructure, including device mapping technologies like LVM and LUKS without compromise on other operating systems that have little ` +
`to no support for Linux's wide range of file systems, mainly aiming macOS and Windows. Linsk does not reimplement any file system. Instead, Linsk ` +
`utilizes a lightweight Alpine Linux VM to tap into the native Linux software ecosystem. The files are then exposed to the host via fast and widely-supported FTP, ` +
`operating at near-hardware speeds.`,
}
func Execute() {
@ -33,5 +35,5 @@ func init() {
rootCmd.AddCommand(shellCmd)
rootCmd.PersistentFlags().BoolVar(&vmDebugFlag, "vmdebug", false, "Enable VM debug mode. This will open an accessible VM monitor. You can log in with root user and no password.")
rootCmd.PersistentFlags().BoolVar(&unrestrictedNetworkingFlag, "unsafe-unrestricted-networking", false, "(UNSAFE) Enable unrestricted networking. This will allow the VM to connect to the internet.")
rootCmd.PersistentFlags().BoolVar(&unrestrictedNetworkingFlag, "unrestricted-networking", false, "Enable unrestricted networking. This will allow the VM to connect to the internet.")
}

View file

@ -13,10 +13,9 @@ import (
)
var runCmd = &cobra.Command{
Use: "run",
// TODO: Fill this
// Short: "",
Args: cobra.ExactArgs(3),
Use: "run",
Short: "Start a VM and expose a file share.",
Args: cobra.ExactArgs(3),
Run: func(cmd *cobra.Command, args []string) {
vmMountDevName := args[1]
fsType := args[2]

View file

@ -14,10 +14,9 @@ import (
)
var shellCmd = &cobra.Command{
Use: "shell",
// TODO: Fill this
// Short: "",
Args: cobra.RangeArgs(0, 1),
Use: "shell",
Short: "Start a VM and access the shell. Useful for formatting drives and debugging.",
Args: cobra.RangeArgs(0, 1),
Run: func(cmd *cobra.Command, args []string) {
var passthroughArg string
if len(args) > 0 {