summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2024-03-12 12:02:59 -0600
committerHombreLaser <sebastian-440@live.com>2024-03-12 12:02:59 -0600
commitafd4e795e3a7e7b34e0d3127f11c05c0e7a2fede (patch)
treeb77740d89fb81353ca2bf5a78863e2ad37e27d7a /src
parent50dbd9007c03f3c0557ea264706216016971d1b3 (diff)
Añade main.py
Diffstat (limited to 'src')
-rw-r--r--src/arg_parser.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/arg_parser.py b/src/arg_parser.py
new file mode 100644
index 0000000..c2db3bd
--- /dev/null
+++ b/src/arg_parser.py
@@ -0,0 +1,18 @@
+import argparse
+
+
+AVAILABLE_COMMANDS_HELP_STRING = """Available commands:
+ row-at n: print row at the nth position
+ get-rows n: print first n rows
+ insert "csv string": insert row at the end, the row must have exactly 3 elements.
+ search "lookup": search "lookup" in the table.
+ """
+
+
+class ArgParser:
+ def __init__(self):
+ self.parser = argparse.ArgumentParser()
+ self.parser.add_argument('-f', required=True, help='CSV file location')
+ self.parser.add_argument('-c', required=True, help=AVAILABLE_COMMANDS_HELP_STRING, nargs=2)
+ self.args = self.parser.parse_args()
+ print(self.args) \ No newline at end of file