Skip to content

Add command line args for description, title, labels and interactive mode#38

Merged
jehiah merged 1 commit into
jehiah:masterfrom
dianaabishop:add-command-line-args-open-pull_12
Apr 16, 2020
Merged

Add command line args for description, title, labels and interactive mode#38
jehiah merged 1 commit into
jehiah:masterfrom
dianaabishop:add-command-line-args-open-pull_12

Conversation

@dianaabishop

@dianaabishop dianaabishop commented Apr 15, 2020

Copy link
Copy Markdown
Contributor

This PR adds functionality to git-open-pull to do the following:

  1. pass a title via a --title flag
  2. pass a description via a file path to --description
  3. pass labels to a --labels flag
  4. chose between interactive and non-interactive mode
  5. --version to get the open-pull and go version

An example of a non-interactive command is: git open-pull --description-file="description.txt" --title="My PR title" --labels="label1, label2" --interactive=false
Interactive mode defaults to true so that current expected behavior continues as expected

@jehiah jehiah left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM, but i think we should also allow overriding settings; in LoadSettings can you code to os.Getenv("GITOPENPULL_TOKEN") etc so all config values can be set via environment varaible as well as git config values?

Comment thread git-open-pull.go

func main() {
if len(os.Args) > 1 {
fmt.Printf("git-open-pull v%s %s\n", Version, runtime.Version())

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a --version argument?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure thing!

Comment thread git-open-pull.go Outdated
@dianaabishop

Copy link
Copy Markdown
Contributor Author

👍 LGTM, but i think we should also allow overriding settings; in LoadSettings can you code to os.Getenv("GITOPENPULL_TOKEN") etc so all config values can be set via environment varaible as well as git config values?

oh yes - I felt like there was something I was forgetting, will add that now!

@dianaabishop

Copy link
Copy Markdown
Contributor Author

@jehiah added option to get settings from env variables as a flag - let me know what you think!

Comment thread settings.go Outdated
Comment thread settings.go Outdated
@dianaabishop dianaabishop requested a review from jehiah April 16, 2020 13:37
Comment thread README.md Outdated
@dianaabishop dianaabishop force-pushed the add-command-line-args-open-pull_12 branch from d188c2e to 201b1e3 Compare April 16, 2020 13:56
@jehiah jehiah added the feature label Apr 16, 2020
@dianaabishop dianaabishop force-pushed the add-command-line-args-open-pull_12 branch from 229d62e to 55f0301 Compare April 16, 2020 14:01
@jehiah jehiah merged commit 54528d2 into jehiah:master Apr 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants