Skip to content
This repository was archived by the owner on Dec 18, 2017. It is now read-only.

Fix the bug that prevents args from flowing to the program started by "k run" #344

Merged
merged 1 commit into from
Jun 18, 2014

Conversation

ChengTian
Copy link
Contributor

parent #336

@@ -139,7 +138,8 @@ private bool ParseArgs(string[] args, out DefaultHostOptions defaultHostOptions,
return 0;
});
},
addHelpCommand: false);
addHelpCommand: false,
throwOnUnexpectedArg: false);
Copy link
Member

Choose a reason for hiding this comment

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

Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because we don't want to report an error when executing k run arg1 arg2. Assume the app in current directory is MyProgram, k run arg1 arg2 should be translated to MyProgram arg1 arg2. Without setting this flag to false, we will get an error message "unexpected argument arg1" output by command-line parser.

Copy link
Member

Choose a reason for hiding this comment

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

I see, this is specifically for the run command but it works fine for the top level k --foo right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, it doesn't break error checking in top level k:

PS C:\Users\wwa\Documents\ProjectK\tmp\KRuntime> k --foo
Specify --help for a list of available options and commands.
TODO: Error: unrecognized flag '--foo'

@ChengTian ChengTian merged commit ff83c31 into dev Jun 18, 2014
@ChengTian ChengTian deleted the fix-args-flowing-in-k-run branch June 18, 2014 02:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants