-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforge.py
30 lines (26 loc) · 859 Bytes
/
forge.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import os
import sys
def makedir(directory, dir_name):
"""
Function to take a parent directory, directory name, permissions as parameters and create a directory at the specified parent directory.
...
Parameters
----------
directory : str
parent directory to create the new directory
dir_name : str
name for the new directory being created
"""
path = os.path.join(directory,dir_name)
os.mkdir(path)
print("Directory created successfully!\n")
if(sys.argv[1] == '--help'):
f = open('help_files/help_mkdir.txt', 'r')
print(f.read())
elif(sys.argv[1] == "--version" or sys.argv[1] == "-v"):
print("mkdir (sea shell) 1.0.0")
elif(sys.argv[1] == "treasure-map"):
f = open('man_files/man_mkdir.txt', 'r')
print(f.read())
else:
makedir(sys.argv[1], sys.argv[2])