Skip to content

Commit

Permalink
Add option to skip confirmations
Browse files Browse the repository at this point in the history
  • Loading branch information
kdrobnyh committed Jun 8, 2022
1 parent 352a4ac commit f001f5f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ SCryptoPy is composed of multiple commands, similar to `git`.
### Common arguments

* `-v, --verbose` - Enable verbose debug output
* `-y, --yes` - Do not ask for confirmation
* `-p, --print_arguments` - Print arguments and exit the script
* `-ded, --no_encrypt_dirnames` - Do not encrypt directory names

Expand Down
14 changes: 11 additions & 3 deletions scryptopy/scrypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,8 @@ def encrypt_wrapper(args):
keyfile=args.keyfile,
double_check=args.double_check,
encrypted_dirnames=not args.no_encrypt_dirnames,
sync=args.sync)
sync=args.sync,
confirm=not args.yes)


def decrypt(input: Union[str, Path], output: Union[str, Path],
Expand Down Expand Up @@ -617,7 +618,8 @@ def decrypt_wrapper(args):
output=args.output,
keyfile=args.keyfile,
encrypted_dirnames=not args.no_encrypt_dirnames,
sync=args.sync)
sync=args.sync,
confirm=not args.yes)


def check(unencrypted: Union[str, Path], encrypted: Union[str, Path],
Expand Down Expand Up @@ -703,12 +705,18 @@ def check_wrapper(args):
unencrypted=args.unencrypted,
encrypted=args.encrypted,
keyfile=args.keyfile,
encrypted_dirnames=~args.no_encrypt_dirnames)
encrypted_dirnames=~args.no_encrypt_dirnames,
confirm=not args.yes)

def find_encrypted_path():
# TODO
pass

def main():
FORMAT = '[{filename}:{lineno} - {funcName}(): {levelname}] {message}'
parser = argparse.ArgumentParser()
parser.add_argument('-y', '--yes', action='store_true',
help='do not ask for confirmation')
parser.add_argument('-v', '--verbose', action='store_true',
help='enable verbose debug output')
parser.add_argument('-p', '--print_arguments', action='store_true',
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = scryptopy
version = 0.12.0
version = 0.12.1
description = a Python library for salty encryption and decryption of files and directories
long_description = file: README.md
long_description_content_type = text/markdown; charset=UTF-8
Expand Down

0 comments on commit f001f5f

Please sign in to comment.