Repository: oclif/core (ts)

Issue:
Return result in Main.ts run function
**Describe the bug**

Everywhere else throughout the call stack for Commands, the result of a command is propagated upwards - [except here in main.ts](https://github.com/oclif/core/blob/main/src/main.ts#L77). As a result, for those looking to interact with the result of commands (short of commands that offer direct support for the filesystem, which works in the interim as an indirect way to get access to command results), we're left hanging - we can properly await a command, but can't properly resolve the result of a command.

**Expected behavior**

It would be great to update the line from:

```ts
await config.runCommand(id, argvSlice, cmd);
```

to:

```ts
return await config.runCommand(id, argvSlice, cmd);
```

So that we can interact with the result of a command without having to write to the file-system as an intermediary.

**Environment (please complete the following information):**
 - applicable on any OS
 - applicable as of `@oclif/core` version `1.24.0`


Pull request description:
Fixes #592 by directly returning the result of commands to the caller
This change allows callers to interact with the result of commands directly rather than having to rely on the filesystem as an intermediary.

Patch:
diff --git a/package.json b/package.json
index db4bcf0..4d3d2f9 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
 {
   "name": "@oclif/core",
   "description": "base library for oclif CLIs",
-  "version": "1.24.0",
+  "version": "1.24.1",
   "author": "Salesforce",
   "bugs": "https://github.com/oclif/core/issues",
   "dependencies": {
diff --git a/src/interfaces/parser.ts b/src/interfaces/parser.ts
index 797de0f..b881500 100644
--- a/src/interfaces/parser.ts
+++ b/src/interfaces/parser.ts
@@ -95,7 +95,7 @@ export type Relationship = {
 export type Deprecation = {
   to?: string;
   message?: string;
-  version?: string;
+  version?: string | number;
 }
 
 export type FlagProps = {
diff --git a/src/main.ts b/src/main.ts
index c3e0585..4323468 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -74,5 +74,5 @@ export async function run(argv = process.argv.slice(2), options?: Interfaces.Loa
   // as an argument, we need to add back the '.' to argv since it was stripped out earlier as part of the
   // command id.
   if (config.pjson.oclif.default === '.' && id === '.' && argv[0] === '.') argvSlice = ['.', ...argvSlice]
-  await config.runCommand(id, argvSlice, cmd)
+  return config.runCommand(id, argvSlice, cmd)
 }


Test patch:
diff --git a/test/command/main.test.ts b/test/command/main.test.ts
index 3df8922..36bf222 100644
--- a/test/command/main.test.ts
+++ b/test/command/main.test.ts
@@ -84,4 +84,9 @@ COMMANDS
   .do(() => run(['foo', 'bar', 'succeed'], path.resolve(__dirname, 'fixtures/typescript/package.json')))
   .do((output: any) => expect(output.stdout).to.equal('it works!\n'))
   .it('runs foo:bar:succeed with space separator')
+
+  fancy
+  .add('result', () => run(['foo', 'bar', 'succeed'], path.resolve(__dirname, 'fixtures/typescript/package.json')))
+  .do((output: any) => expect(output.result).to.equal('returned success!'))
+  .it('returns foo:bar:succeed result directly')
 })