Skip to content

Instantly share code, notes, and snippets.

@cosminpopescu14
Created November 1, 2020 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cosminpopescu14/804e36c9c4ffd2220b99e9abc9df7f95 to your computer and use it in GitHub Desktop.
Save cosminpopescu14/804e36c9c4ffd2220b99e9abc9df7f95 to your computer and use it in GitHub Desktop.
# This is a sample Python script.
# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
import os
import argparse
def get_args():
# Create the parser
my_parser = argparse.ArgumentParser(description='List the content of a folder')
# Add the arguments
my_parser.add_argument("path", help='View current path')
my_parser.add_argument("--change", help="Chage java home path")
args = my_parser.parse_args()
return args
def print_path():
paths = ["JAVA_HOME"]
for item, value in os.environ.items():
if item in paths:
print('{}: {}'.format(item, value))
def change_java_home_path():
print("change_java_home_path")
def main() -> None:
args = get_args()
print(args.change)
if args.path == "path":
print_path()
if args.change != '':
change_java_home_path()
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
main()
# See PyCharm help at https://www.jetbrains.com/help/pycharm/
@cosminpopescu14
Copy link
Author

Not done yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment