mirror of
https://github.com/Garmelon/PFERD.git
synced 2026-04-12 15:35:05 +02:00
Add fancy CLI options
This commit is contained in:
parent
c454fabc9d
commit
05573ccc53
4 changed files with 250 additions and 56 deletions
|
|
@ -32,6 +32,14 @@ class Redownload(Enum):
|
|||
ALWAYS = "always"
|
||||
ALWAYS_SMART = "always-smart"
|
||||
|
||||
@staticmethod
|
||||
def from_string(string: str) -> "Redownload":
|
||||
try:
|
||||
return Redownload(string)
|
||||
except ValueError:
|
||||
raise ValueError("must be one of 'never', 'never-smart',"
|
||||
" 'always', 'always-smart'")
|
||||
|
||||
|
||||
class OnConflict(Enum):
|
||||
PROMPT = "prompt"
|
||||
|
|
@ -39,6 +47,14 @@ class OnConflict(Enum):
|
|||
REMOTE_FIRST = "remote-first"
|
||||
NO_DELETE = "no-delete"
|
||||
|
||||
@staticmethod
|
||||
def from_string(string: str) -> "OnConflict":
|
||||
try:
|
||||
return OnConflict(string)
|
||||
except ValueError:
|
||||
raise ValueError("must be one of 'prompt', 'local-first',"
|
||||
" 'remote-first', 'no-delete'")
|
||||
|
||||
|
||||
@dataclass
|
||||
class Heuristics:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue