summaryrefslogtreecommitdiff
path: root/cmd/btrfs-rec/inspect_lstrees.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-03-10 19:31:50 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2023-04-04 14:08:38 -0600
commit5d2729a4e15dca6e22187cd5de272a2a2d191131 (patch)
tree79a9fd988757a16b7d053d71ea5fd1e70c491094 /cmd/btrfs-rec/inspect_lstrees.go
parentbc94e6dbf6e9212820615a3d3f3e4542693351a6 (diff)
cmd/btrfs-rec: Move --node-list to be a global flag
Diffstat (limited to 'cmd/btrfs-rec/inspect_lstrees.go')
-rw-r--r--cmd/btrfs-rec/inspect_lstrees.go12
1 files changed, 3 insertions, 9 deletions
diff --git a/cmd/btrfs-rec/inspect_lstrees.go b/cmd/btrfs-rec/inspect_lstrees.go
index cb7bef8..decb75c 100644
--- a/cmd/btrfs-rec/inspect_lstrees.go
+++ b/cmd/btrfs-rec/inspect_lstrees.go
@@ -25,15 +25,14 @@ import (
)
func init() {
- var nodeListFilename string
- cmd := &cobra.Command{
+ inspectors.AddCommand(&cobra.Command{
Use: "ls-trees",
Short: "A brief view what types of items are in each tree",
Long: "" +
"If no --node-list is given, then a slow sector-by-sector scan " +
"will be used to find all lost+found nodes.",
Args: cliutil.WrapPositionalArgs(cobra.NoArgs),
- RunE: runWithReadableFSAndNodeList(&nodeListFilename, func(fs btrfs.ReadableFS, nodeList []btrfsvol.LogicalAddr, cmd *cobra.Command, _ []string) error {
+ RunE: runWithReadableFSAndNodeList(func(fs btrfs.ReadableFS, nodeList []btrfsvol.LogicalAddr, cmd *cobra.Command, _ []string) error {
ctx := cmd.Context()
var treeErrCnt int
@@ -113,10 +112,5 @@ func init() {
return nil
}),
- }
- cmd.Flags().StringVar(&nodeListFilename, "node-list", "",
- "Output of 'btrfs-recs inspect [rebuild-mappings] list-nodes' to use for a lost+found tree")
- noError(cmd.MarkFlagFilename("node-list"))
-
- inspectors.AddCommand(cmd)
+ })
}