n0v1c3 / vira

Create and update your Jira issues while inside Vim!
MIT License
96 stars 12 forks source link

Add CLI arguments to vira.py #1

Closed mikeboiko closed 5 years ago

mikeboiko commented 5 years ago

This would primarily be used to set server and auth info. I could code this up using argparse.

n0v1c3 commented 5 years ago

I am also working on this as well. Currently I use the vim script to pass the auth through and I thought of a pop-up to let you select your server, enter username, password. Then go into select project.

I have now started to use the python code in my day to day so I do expect it to become quite a powerful standalone from the CLI

mikeboiko commented 5 years ago

Ok nice. This is the format that I've used for a bunch of python scripts now and I think it's quite pythonic.

'''
Vira - do all the jira-ing in vim
'''

# The help file will show the module docstring with this class
parser = argparse.ArgumentParser(
    description=__doc__, formatter_class=argparse.ArgumentDefaultsHelpFormatter)

# Specify optional arg
parser.add_argument(
    '-u',
    '--user',
    action='store',
    default='travis',
    help='Jira user name'
)

# Main Code
# ...

# Run script if this file is executed directly
if __name__ == '__main__':
    args = parser.parse_args()
    main()
n0v1c3 commented 5 years ago

Might as well put it in now. Do a pull request and I will merge it in.

mikeboiko commented 5 years ago

k will do

n0v1c3 commented 5 years ago

I also have made some lame CLI menus for navigating and editing your issues. I will test your other uploads in my new VIM and then push them this evening.

n0v1c3 commented 5 years ago

Although I am sure you are already using the function inside a CLI loop somewhere...

mikeboiko commented 5 years ago

5 the merge looks good