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

@ -11,9 +11,7 @@ import (
var rootCmd = &cobra.Command{
Use: "imgbuilder",
// TODO: Fill this
// Short: "",
// Long: ``,
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])

View file

@ -14,8 +14,7 @@ import (
var lsCmd = &cobra.Command{
Use: "ls",
// TODO: Fill this
// Short: "",
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 {

View file

@ -10,9 +10,11 @@ import (
var rootCmd = &cobra.Command{
Use: "linsk",
// TODO: Fill this
// Short: "",
// Long: ``,
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

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

View file

@ -15,8 +15,7 @@ import (
var shellCmd = &cobra.Command{
Use: "shell",
// TODO: Fill this
// Short: "",
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

View file

@ -118,7 +118,7 @@ func NewVM(logger *slog.Logger, cfg VMConfig) (*VM, error) {
if !cfg.UnrestrictedNetworking {
netdevOpts += ",restrict=on"
} else {
logger.Warn("Running with unsafe unrestricted networking")
logger.Warn("Running with unrestricted networking")
}
for _, pf := range cfg.ExtraPortForwardingRules {
@ -267,7 +267,6 @@ func (vm *VM) Run() error {
knownHosts, err := ParseSSHKeyScan(sshKeyScan)
if err != nil {
// TODO: Test what actually happens in inline critical errors like this.
globalErrFn(errors.Wrap(err, "parse ssh key scan"))
return
}