rewrite with commander

This commit is contained in:
2020-11-06 23:51:23 +01:00
parent e9a7e03af7
commit 60d7e0b561
27 changed files with 702 additions and 766 deletions

13
src/handlers/forget.ts Normal file
View File

@@ -0,0 +1,13 @@
import { checkAndConfigureBackendsForLocations } from '../backend'
import { forgetAll } from '../forget'
import { Flags, Locations } from '../types'
import { checkIfResticIsAvailable, parseLocations } from '../utils'
export default function forget({ location, all, dryRun }: Flags) {
checkIfResticIsAvailable()
const locations: Locations = parseLocations(location, all)
checkAndConfigureBackendsForLocations(locations)
forgetAll(locations, dryRun)
console.log('\nFinished!'.underline + ' 🎉')
}