[cs615asa] [project] Initial commit for argument parsing

Charles Magyar IV cmagyar at stevens.edu
Mon Mar 8 19:45:49 EST 2021


Looks good to me.

Professor - We've created a code_review subchannel in the slack.

Would it be acceptable to move these reviews to the slack where the class can then vote on these pull requests?

Also, we may want to have another entity handling pull-requests.
________________________________
From: cs615asa-bounces at lists.stevens.edu <cs615asa-bounces at lists.stevens.edu> on behalf of Edward Minnix III <eminnix at stevens.edu>
Sent: Monday, March 8, 2021 4:35 PM
To: CS615 - Aspects of System Administration <cs615asa at lists.stevens.edu>
Subject: [cs615asa] [project] Initial commit for argument parsing

The following changes since commit 7462c77c3915a9802bdb06c2f4ae4f87347a526b:

  Added initial argument parsing (2021-03-08 19:17:27 -0500)

are available in the Git repository at:

  eminnix at cs615asa:~eminnix/ebs-backup main

for you to fetch changes up to 7462c77c3915a9802bdb06c2f4ae4f87347a526b:

  Added initial argument parsing (2021-03-08 19:17:27 -0500)

----------------------------------------------------------------
diff --git a/src/__main__.py b/src/__main__.py
new file mode 100644
index 0000000..4d6d222
--- /dev/null
+++ b/src/__main__.py
@@ -0,0 +1,46 @@
+"""
+ebs-backup
+
+Usage:
+  ebs-backup [-h] [-l filter] [-r filter] [-v volume-id] <dir>
+
+Options:
+  -h            Print a usage message and exit
+  -l filter     Pass data through the given filter command on the local
+                host before copying the data to the remote system.
+  -r filter     Pass data through the given filter command on the remote
+                host before writing the data to the volume.
+  -v volume-id  Use the given volume instead of creating a new one.
+"""
+import argparse
+
+parser = argparse.ArgumentParser(
+    description="backup a directory into Elastic Block Storage (EBS)"
+)
+parser.add_argument(
+    "-l",
+    metavar="filter",
+    type=str,
+    help="Pass data through the given filter command on the local
host before copying the\
+data to the remote system.",
+)
+parser.add_argument(
+    "-r",
+    metavar="filter",
+    type=str,
+    help="Pass data through the given filter command on the remote\
+                host before writing the data to the volume.",
+)
+parser.add_argument(
+    "-v",
+    metavar="volume-id",
+    type=str,
+    help="Use the given volume instead of creating a new one.",
+)
+
+if __name__ == "__main__":
+    args = parser.parse_args()
+
+    local_filter = args.l
+    remote_filter = args.r
+    volume_id = args.v
_______________________________________________
cs615asa mailing list
cs615asa at lists.stevens.edu
https://lists.stevens.edu/mailman/listinfo/cs615asa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.stevens.edu/pipermail/cs615asa/attachments/20210309/68260b82/attachment.html>


More information about the cs615asa mailing list