Add --version flag with build-time injection via ldflags. Add --mountpoint/-m flag to mount for one-off mount point override. Change init aliases from device path basename (sda1) to UUID prefix (b8b2f8e3) for stability across boots. Add .gitignore. Update flake.nix with version injection. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
25 lines
327 B
Go
25 lines
327 B
Go
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var rootCmd = &cobra.Command{
|
|
Use: "arca",
|
|
Short: "Mount and unmount LUKS-encrypted volumes",
|
|
}
|
|
|
|
func SetVersion(v string) {
|
|
rootCmd.Version = v
|
|
}
|
|
|
|
func Execute() {
|
|
if err := rootCmd.Execute(); err != nil {
|
|
fmt.Fprintln(os.Stderr, err)
|
|
os.Exit(1)
|
|
}
|
|
}
|