diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-14 21:31:51 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-14 21:31:51 -0600 |
commit | 697d79fb12b79b65a501ec90dbb45ea165b3457d (patch) | |
tree | 7b8275fe12a2f2d7c57f1e9419b97e693b715f36 /cmd/btrfs-rec/inspect_mount.go | |
parent | 9e9b4e8ac67052d667f6e7fae0a6620b6dbc50c7 (diff) | |
parent | afd2fe91ec604491bd8978b1880c6482e7394240 (diff) |
Merge branch 'lukeshu/reorg-cli'
Diffstat (limited to 'cmd/btrfs-rec/inspect_mount.go')
-rw-r--r-- | cmd/btrfs-rec/inspect_mount.go | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/cmd/btrfs-rec/inspect_mount.go b/cmd/btrfs-rec/inspect_mount.go index f3fda34..4582f9f 100644 --- a/cmd/btrfs-rec/inspect_mount.go +++ b/cmd/btrfs-rec/inspect_mount.go @@ -14,17 +14,16 @@ import ( func init() { var skipFileSums bool - cmd := subcommand{ - Command: cobra.Command{ - Use: "mount MOUNTPOINT", - Short: "Mount the filesystem read-only", - Args: cliutil.WrapPositionalArgs(cobra.ExactArgs(1)), - }, - RunE: func(fs *btrfs.FS, cmd *cobra.Command, args []string) error { + cmd := &cobra.Command{ + Use: "mount MOUNTPOINT", + Short: "Mount the filesystem read-only", + Args: cliutil.WrapPositionalArgs(cobra.ExactArgs(1)), + RunE: runWithRawFS(func(fs *btrfs.FS, cmd *cobra.Command, args []string) error { return mount.MountRO(cmd.Context(), fs, args[0], skipFileSums) - }, + }), } - cmd.Command.Flags().BoolVar(&skipFileSums, "skip-filesums", false, + cmd.Flags().BoolVar(&skipFileSums, "skip-filesums", false, "ignore checksum failures on file contents; allow such files to be read") - inspectors = append(inspectors, cmd) + + inspectors.AddCommand(cmd) } |