Skip to content

Commit

Permalink
add -y option alias --yes
Browse files Browse the repository at this point in the history
  • Loading branch information
sellth committed May 10, 2023
1 parent 73fa2b7 commit f21802c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cubi_tk/sodar/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def setup_argparse(cls, parser: argparse.ArgumentParser) -> None:
)
parser.add_argument(
"-y",
"--yes",
default=False,
action="store_true",
help="Don't ask for permission prior to transfer.",
Expand Down Expand Up @@ -218,7 +219,7 @@ def execute(self):
logger.info("Planning to create the following sub-collections:")
for d in dirs:
print(f"{self.target_coll}/{str(d)}")
if not self.args.y:
if not self.args.yes:
if not input("Is this OK? [y/N] ").lower().startswith("y"):
logger.error("Aborting at your request.")
sys.exit(0)
Expand Down Expand Up @@ -247,7 +248,7 @@ def execute(self):
logger.info("Into this iRODS collection:")
print(f"{self.lz_irods_path}/{self.target_coll}/")

if not self.args.y:
if not self.args.yes:
if not input("Is this OK? [y/N] ").lower().startswith("y"):
logger.error("Aborting at your request.")
sys.exit(0)
Expand Down

0 comments on commit f21802c

Please sign in to comment.