helper

package
v2.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NormalizeVolumeNameCmd = &cobra.Command{
	Use:   "normalize-volume-name [path]",
	Short: "get the device name from the path",
	Long: `Get the device name from the path.
The path could be a directory, a partition, or a block device.
The block device name will be printed out.`,
	Run: func(cmd *cobra.Command, args []string) {
		if len(args) != 1 {
			cmd.Help()
			os.Exit(1)
		}

		volumePath := args[0]
		deviceName, err := normalizeVolumeName(volumePath)
		if err != nil {
			fmt.Fprintln(os.Stderr, err)
			os.Exit(1)
		}

		fmt.Println(deviceName)
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL