aboutsummaryrefslogtreecommitdiff
path: root/src/zen/cmds/dedup_cmd.h
blob: 835b35e92c1442906c1e2ebb651ee572bb9692f5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright Epic Games, Inc. All Rights Reserved.

#pragma once

#include "../zen.h"

namespace zen {

/** Deduplicate files in a tree using block cloning
 */
class DedupCommand : public ZenCmdBase
{
public:
	static constexpr char Name[]		= "dedup";
	static constexpr char Description[] = "Dedup files";

	DedupCommand();
	~DedupCommand();

	virtual cxxopts::Options& Options() override { return m_Options; }
	virtual void			  Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) override;
	virtual ZenCmdCategory&	  CommandCategory() const override { return g_UtilitiesCategory; }

private:
	cxxopts::Options		 m_Options{Name, Description};
	std::vector<std::string> m_Positional;
	std::filesystem::path	 m_DedupSource;
	std::filesystem::path	 m_DedupTarget;
	size_t					 m_SizeThreshold = 1024 * 1024;
};

}  // namespace zen