refactor: remove unlink feature

pull/7/head
sundowndev 2022-11-29 15:17:56 +04:00
parent c41b093f01
commit 6e51108a3b
3 changed files with 0 additions and 8 deletions

View File

@ -18,7 +18,6 @@ type RootCmdOptions struct {
Write bool
Zero bool
Iterations int
Unlink bool
//ExtraPaths []string
FilterRules []string
}
@ -72,7 +71,6 @@ covermyass --write -z -n 5
shredOptions := &shred.ShredderOptions{
Zero: opts.Zero,
Iterations: opts.Iterations,
Unlink: opts.Unlink,
}
s := shred.New(shredOptions)
for _, result := range a.Results() {
@ -95,7 +93,6 @@ covermyass --write -z -n 5
cmd.PersistentFlags().BoolVar(&opts.ExcludeReadOnly, "no-read-only", false, "Exclude read-only files in the list. Must be used with --list")
cmd.PersistentFlags().BoolVarP(&opts.Zero, "zero", "z", false, "Add a final overwrite with zeros to hide shredding")
cmd.PersistentFlags().IntVarP(&opts.Iterations, "iterations", "n", 3, "Overwrite N times instead of the default")
cmd.PersistentFlags().BoolVarP(&opts.Unlink, "unlink", "u", false, "Deallocate and remove file after overwriting")
cmd.PersistentFlags().StringSliceVarP(&opts.FilterRules, "filter", "f", []string{}, "File paths to ignore (supports glob patterns)")
return cmd

View File

@ -28,7 +28,6 @@ type File interface {
type ShredderOptions struct {
Zero bool
Iterations int
Unlink bool
}
type Shredder struct {

View File

@ -53,7 +53,6 @@ func TestShredder_shred(t *testing.T) {
options: ShredderOptions{
Zero: false,
Iterations: 3,
Unlink: false,
},
mocks: func(fakeFileInfo *mocks.FileInfo, fakeFile *mocks.File) {
fakeFileInfo.On("Size").Return(int64(0)).Times(1)
@ -64,7 +63,6 @@ func TestShredder_shred(t *testing.T) {
options: ShredderOptions{
Zero: false,
Iterations: 3,
Unlink: false,
},
mocks: func(fakeFileInfo *mocks.FileInfo, fakeFile *mocks.File) {
fakeFileInfo.On("Size").Return(int64(64)).Times(4)
@ -81,7 +79,6 @@ func TestShredder_shred(t *testing.T) {
options: ShredderOptions{
Zero: false,
Iterations: 10,
Unlink: false,
},
mocks: func(fakeFileInfo *mocks.FileInfo, fakeFile *mocks.File) {
fakeFileInfo.On("Size").Return(int64(2000000)).Times(11)
@ -98,7 +95,6 @@ func TestShredder_shred(t *testing.T) {
options: ShredderOptions{
Zero: false,
Iterations: 3,
Unlink: false,
},
mocks: func(fakeFileInfo *mocks.FileInfo, fakeFile *mocks.File) {
fakeFileInfo.On("Size").Return(int64(2000)).Times(2)