shell match case
This commit is contained in:
parent
f82311b62d
commit
6e519aedbc
1 changed files with 14 additions and 0 deletions
14
python/psd_shell_match_case.py
Normal file
14
python/psd_shell_match_case.py
Normal file
|
@ -0,0 +1,14 @@
|
|||
while True:
|
||||
cmd = input('CSD>').split()
|
||||
|
||||
match cmd:
|
||||
case ('delete', path) | ('remove', path) | ('erase', path):
|
||||
print(f'{path} dosyası siliniyor')
|
||||
case 'copy', source_path, dest_path:
|
||||
print(f'{source_path} dosyası {dest_path} olarak kopyalanıyor')
|
||||
case 'rename', oldname, newname:
|
||||
print(f'{oldname} dosyanının ismi {newname} olarak değiştiriliyor')
|
||||
case 'exit' | 'quit':
|
||||
break
|
||||
case _:
|
||||
print('geçeriz komut!')
|
Loading…
Add table
Reference in a new issue