Repository: yargs/yargs (js)

Issue:
Global middleware don't work in 12.0.1
I've tried this code:

```
const yargs = require('yargs');

const mwFunc1 = argv => console.log('I\'m a middleware function');
const mwFunc2 = argv => console.log('I\'m another middleware function');

yargs
  .command('myCommand', 'some command', {}, function(argv){
    console.log('Running myCommand!');
  })
  .middleware([mwFunc1, mwFunc2]).argv;
```


OUTPUT: 
```
Running myCommand!
```

No trace of the middlewares :(


Pull request:
I-1178: Middleware fix
- closes #1178 

Patch:
diff --git a/lib/command.js b/lib/command.js
index bbd986e..ea7aa3d 100644
--- a/lib/command.js
+++ b/lib/command.js
@@ -19,7 +19,8 @@ module.exports = function command (yargs, usage, validation, globalMiddleware) {
     let aliases = []
     handler = handler || (() => {})
     middlewares = middlewares || []
-    middlewares = globalMiddleware.concat(middlewares)
+    globalMiddleware.push(...middlewares)
+    middlewares = globalMiddleware
     if (Array.isArray(cmd)) {
       aliases = cmd.slice(1)
       cmd = cmd[0]


Test patch:
diff --git a/test/middleware.js b/test/middleware.js
index 764b1b0..0423768 100644
--- a/test/middleware.js
+++ b/test/middleware.js
@@ -53,4 +53,31 @@ describe('middleware', () => {
       .exitProcess(false) // defaults to true.
       .parse()
   })
+
+  it('should be able to register middleware regardless of when middleware is called', function (done) {
+    yargs(['mw'])
+      .middleware([
+        function (argv) {
+          argv.mw1 = 'mw1'
+        }
+      ])
+      .command(
+        'mw',
+        'adds func list to middleware',
+        function () {},
+        function (argv) {
+          // we should get the argv filled with data from the middleware
+          argv.mw1.should.equal('mw1')
+          argv.mw2.should.equal('mw2')
+          return done()
+        }
+      )
+      .middleware([
+        function (argv) {
+          argv.mw2 = 'mw2'
+        }
+      ])
+      .exitProcess(false) // defaults to true.
+      .parse()
+  })
 })