Conversation
Works like `get` except it opens up the specified PR in `$EDITOR`.
afbe90a to
91cec2b
Compare
danobi
left a comment
There was a problem hiding this comment.
thanks for the pr! minor ux comments.
| /// Pull request to review (eg. `danobi/prr/24`) | ||
| pr: String, | ||
| }, | ||
| /// Get a pull request and open it in $EDITOR |
There was a problem hiding this comment.
Rather than a new subcommand to get + open, how about making prr-edit only open a review file if it exists (so no implicit prr-get). And also add a --open flag to prr-get?
| let (owner, repo, pr_num) = prr.parse_pr_str(&pr)?; | ||
| let review = prr.get_pr(&owner, &repo, pr_num, force).await?; | ||
| let editor = env::var("EDITOR")?; | ||
| let path = review.path(); | ||
| std::process::Command::new(editor) |
There was a problem hiding this comment.
Probably want to move this code into prr.rs if we wnat to share open functionality between prr-edit and prr get --open
Co-authored-by: Daniel Xu <accounts@dxuuu.xyz>
|
I can probably get to the rest later this week, or feel free to edit & submit. |
Couldn't we suggest adding a shell alias doing something like |
|
@Shugyousha On principle I agree, but sometimes out-of-the-box functionality is good for ux. Plus, mail clients like mutt/neomutt will do similar things for replying to mail. So I don't mind adding this. Fwiw I will probably use |
|
Some of the code in this PR went into 149a8fe |
|
Finished in e7f4e43 |
|
Thanks! |
Works like
getexcept it opens up the specified PR in$EDITOR.Fixes #2.