@@ -35,10 +35,11 @@ const landOptions = {
3535function builder ( yargs ) {
3636 return yargs
3737 . options ( landOptions ) . positional ( 'prid' , {
38- describe : 'ID of the Pull Request' ,
39- type : 'number'
38+ describe : 'ID or URL of the Pull Request'
4039 } )
4140 . epilogue ( epilogue )
41+ . example ( 'git node land https://github.com/nodejs/node/pull/12344' ,
42+ 'Land https://github.com/nodejs/node/pull/12344 in the current directory' )
4243 . example ( 'git node land 12344' ,
4344 'Land https://github.com/nodejs/node/pull/12344 in the current directory' )
4445 . example ( 'git node land --abort' ,
@@ -58,8 +59,12 @@ const FINAL = 'final';
5859const CONTINUE = 'continue' ;
5960const ABORT = 'abort' ;
6061
62+ const GITHUB_PULL_REQUEST_URL = / g i t h u b .c o m \/ [ ^ / ] + \/ [ ^ / ] + \/ p u l l \/ ( \d + ) / ;
63+
6164function handler ( argv ) {
62- if ( argv . prid && Number . isInteger ( argv . prid ) ) {
65+ if ( argv . prid &&
66+ ( Number . isInteger ( argv . prid ) || argv . prid . match ( GITHUB_PULL_REQUEST_URL ) )
67+ ) {
6368 return land ( START , argv ) ;
6469 }
6570 const provided = [ ] ;
@@ -124,6 +129,10 @@ async function main(state, argv, cli, req, dir) {
124129 }
125130
126131 if ( state === START ) {
132+ if ( argv . prid . match && argv . prid . match ( GITHUB_PULL_REQUEST_URL ) ) {
133+ argv . prid = Number ( argv . prid . split ( '/' ) . pop ( ) ) ;
134+ }
135+
127136 if ( session . hasStarted ( ) ) {
128137 cli . warn (
129138 'Previous `git node land` session for ' +
0 commit comments