func vhdInspectCmdHandler()

in vhdInspectCmdHandler.go [37:121]


func vhdInspectCmdHandler() cli.Command {
	return cli.Command{
		Name:  "inspect",
		Usage: "Commands to inspect local VHD",
		Subcommands: []cli.Command{
			{
				Name:  "header",
				Usage: "Show VHD header",
				Flags: []cli.Flag{
					cli.StringFlag{
						Name:  "path",
						Usage: "Path to VHD.",
					},
				},
				Action: showVhdHeader,
			},
			{
				Name:  "footer",
				Usage: "Show VHD footer",
				Flags: []cli.Flag{
					cli.StringFlag{
						Name:  "path",
						Usage: "Path to VHD.",
					},
				},
				Action: showVhdFooter,
			},
			{
				Name:  "bat",
				Usage: "Show a range of VHD Block allocation table (BAT) entries",
				Flags: []cli.Flag{
					cli.StringFlag{
						Name:  "path",
						Usage: "Path to VHD.",
					},
					cli.StringFlag{
						Name:  "start-range",
						Usage: "Start range.",
					},
					cli.StringFlag{
						Name:  "end-range",
						Usage: "End range.",
					},
					cli.BoolFlag{
						Name:  "skip-empty",
						Usage: "Do not show BAT entries pointing to empty blocks.",
					},
				},
				Action: showVhdBAT,
			},
			{
				Name:  "block",
				Usage: "Inspect VHD blocks",
				Subcommands: []cli.Command{
					{
						Name:  "info",
						Usage: "Show blocks general information",
						Flags: []cli.Flag{
							cli.StringFlag{
								Name:  "path",
								Usage: "Path to VHD.",
							},
						},
						Action: showVhdBlocksInfo,
					},
					{
						Name:  "bitmap",
						Usage: "Show sector bitmap of a expandable disk's block",
						Flags: []cli.Flag{
							cli.StringFlag{
								Name:  "path",
								Usage: "Path to VHD.",
							},
							cli.StringFlag{
								Name:  "block-index",
								Usage: "Index of the block.",
							},
						},
						Action: showVhdBlockBitmap,
					},
				},
			},
		},
	}
}